Last Occurance of a value formula

jcountry22

New Member
Joined
Aug 15, 2014
Messages
36
trying to come up with a formula that takes avrg Jan Purchase Price Less December price * Qty of JAN.

my obstacle is that if there is no Dec price, to have the formula pick up Nov price. If no NOV price, then the last month and so forth...

then I'll have the same for FEB price LESS dec price.. if no DEC then Nov, if not NOV then, OCT and so forth.

months are sequential along row 3

all avrg purchase prices are in the same row (start on row 4) on SHEET 1 ----- Qty for same item is in the same row (row 4) on SHEET 2, occur in the same columns
jan 2017 = b4
feb 2017 = c4
and so forth for the columns.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
It's not clear how you data is set up, however it sounds as though you might want to be using the last number in a sequence?

You can use a formula like this to find the last value in a row (or column / range!).

Code:
=LOOKUP(2,1/(NOT(ISBLANK(1:1))),1:1)

That will find you the last value in Row 1, you can change this to columns or a range of data if required.

You'd use it like;

Code:
=[Jan Purchase Price]-LOOKUP(2,1/(NOT(ISBLANK(1:1))),1:1)*[Qty of JAN]

If you can't work with that then post back with an example of your data and an expected result, remember we can't see your data and aren't familiar with your setup at all :)
 
Upvote 0
That works perfectly!!! i just had to do as you mentioned and change the columns/range of data i'm wanting to find the last available value in.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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