How to pick up the last value in a column to use in a formula

chariot101

New Member
Joined
May 30, 2024
Messages
2
Office Version
  1. Prefer Not To Say
Platform
  1. MacOS
I've got a formula that needs to do a calculation that when column B has a certain value, then the value in column F needs to minus the previous value in column F. The problem is the previous value in column F isn't always on the previous row as if column B has a certain value then it's blank. I'm not sure on the best way to do this. At the moment I have:

=IF(NOT(B5="Get on"),F5-F4,"")

I think the easiest thing to do would be to add another IF statement to say IF B5 = Get on then F5 should equal F4 so it puts the previous value in F4 so the above calculation should be correct, but I can't get my head around how to do this. Or maybe there's a better solution?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
It's a little vague without example data
Try
IF(B5<>"Get on", F5-LOOKUP(2,1/(F$1:F4<>""),F$1:F4),"")

This
LOOKUP(2,1/(F$1:F4<>""),F$1:F4)
will find the last non blank value in column F up to F4
 
Upvote 0
Solution

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top