Formula to find last non blank cell value in a range

G00DNESS

Board Regular
Joined
Aug 6, 2014
Messages
60
I need help finding the value of the last non blank cell in the range (CO40:DB40). These cells do have formulas in them. Some cells may have zero (0) values. If cells (CO40:DB40) are all blank, than I'd like the answer to be zero (0). Thanks!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Maybe:
=IF(COUNTA(CO40:DB40)=0,0,INDEX(CO40:DB40,MAX(IF(CO40:DB40<>"",ROW(CO40:DB40)))))

End with:
CTRL+SHIFT+ENTER
 
Upvote 0
I'm thinking theres probably a better way but maybe....

=IFERROR(LOOKUP(2,1/((CO40:DB40<>0)*(CO40:DB40<>"")),CO40:DB40),0)
 
Upvote 0
Did you press CTRL+SHIFT+ENTER to confirm?
I checked again and worked just fine in my data!!
 
Upvote 0
yeah, you're gonna have to do a little better than that as far as explaining things.

what version of excel?
Are you returning a number or text?

the lookup works on both so I'm not sure why your getting a #value error especially since the iferror would trap it and return 0

did you type out the formulas or copy and paste them?
 
Upvote 0
I copied+paste. And I did hit shift control enter keys at same time. It did nothing. Excel version 2003. Sorry about that.
 
Upvote 0
I copied+paste. And I did hit shift control enter keys at same time. It did nothing. Excel version 2003. Sorry about that.

Are all of the cells formula-driven, or just some? Do the formulas return blanks ("") or 0s?

A small example would help us to understand what we're dealing with.

Matty
 
Upvote 0
maybe something like

=IF(COUNTIF(CO40:DO40,"?*")=0,0,LOOKUP(2,1/((CO40:DB40<>0)*(CO40:DB40<>"")),CO40:DB40))

should be compatible with 2003

the IFERROR in the original formula was not
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,091
Latest member
gaurav_7829

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