LOOKUP,IF problem

Clwd9Rider

New Member
Joined
Mar 29, 2019
Messages
5
I need to retreive the value from the last non blank cell in a set of cells (not on the same row or column), so, I use this formula:
=LOOKUP(9.999999999999E+307,IF(L65>=0,L65,IF(J65>=0,J65,IF(H65>=0,H65,IF(F65>=0,F65,IF(D65>=0,D65,IF(B65>=0,B65,IF(L50>=0,L50,IF(J50>=0,J50,IF(H50>=0,H50,IF(F50>=0,F50,IF(D50>=0,D50,IF(B50>=0,B50,IF(L35>=0,L35,IF(J35>=0,J35,IF(H35>=0,H35,IF(F35>=0,F35,IF(D35>=0,D35,IF(B35>=0,B35,IF(L20>=0,L20,IF(J20>=0,J20,IF(H20>=0,H20,IF(F20>=0,F20,IF(D20>=0,D20))))))))))))))))))))))))

ok, the issue is: if I use : IF(L65>0,L65 …etc , everything works like a charm, but if I use the >= combination it turn #N/A.
I am really stuck, do not know what to do, I need to use 0 in next cell to clear the value as there is another sheet reading and calculating the last value, so when for an example: this month I have to make these payments, but, next month some of them I shall not pay, so, I need to zero the value for next month.
Thank you for your help
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi. I think there should be shorter formulas but this should work:

=IFERROR(LOOKUP(2,1/((LEN(A65:L65)>0)*(A65:L65>=0)*(MOD(COLUMN(A65:L65),2)=0)),A65:L65),IFERROR(LOOKUP(2,1/((LEN(A50:L50)>0)*(A50:L50>=0)*(MOD(COLUMN(A50:L50),2)=0)),A50:L50),IFERROR(LOOKUP(2,1/((LEN(A35:L35)>0)*(A35:L35>=0)*(MOD(COLUMN(A35:L35),2)=0)),A35:L35),IFERROR(LOOKUP(2,1/((LEN(A20:L20)>0)*(A20:L20>=0)*(MOD(COLUMN(A20:L20),2)=0)),A20:L20),"NA"))))
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,186
Members
452,615
Latest member
bogeys2birdies

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