Freda K
Freda K

Reputation: 464

Last Observation Carried Forward LOCF

Is there a simple method for calculating Last Observation Carried Forward (LOCF) in Excel.

For example, in a clinical trial, if there are 8 scheduled events and the patient only attended 4, what is a simple method to calculate the Last Observation Carried Forward?

Upvotes: 1

Views: 1656

Answers (1)

Freda K
Freda K

Reputation: 464

Column A contains simple sequential numbers (1, 2, 3, 4, 5...)
Column B contains the observations (24, 23, , , 26...)
Column C contains a formula to calculate the Latest Populated Event

=IF(B2<>"",A2,"")

Column D contains a formula to calculate the Last Observation Carried Forward (LOCF)

=IFERROR(IF(B2<>"",B2,VLOOKUP(MAX(C$2:C2),A$2:B2,2,FALSE)),"")

Screenshots
Screenshot showing formulas Screenshot showing results

Upvotes: 2

Related Questions