Finding cell value of first non-blank cell in a range

G00DNESS

Board Regular
Joined
Aug 6, 2014
Messages
60
Using Excel 2003, in Cell CZ32, I am trying to use a formula that will return the value of the first non blank cell in CM32:CY32. CM32:CY32 contain formulas. I will need to use this formula separately for rows 32--58. I'm using the following, but if the cells within the range are all blank it returns errors.

1.
=(INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)))
(and CTRL+SHIFT+ENTER)
Returns: Error #N/A

2.
=IFERROR(INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)),"")
(and CTRL+SHIFT+ENTER)
Returns: Error #NAME?

Any help with this is much appreciated.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
IFERROR was introduced w/Excel2007 - so Excel 2003 doesn't recognize the name of that function. Try:
Rich (BB code):
=IF(ISERROR(INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0))),"",INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)))

 
Upvote 0
IFERROR was introduced w/Excel2007 - so Excel 2003 doesn't recognize the name of that function. Try:
Rich (BB code):
=IF(ISERROR(INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0))),"",INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)))

Thank you so much Joe! It worked quite well.
 
Upvote 0
Also, it might be of interest:

If a text-valued range:
Rich (BB code):
=IF(COUNTIF(CM32:CY32,"?*"),INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)),"")
If a numeric range:
Rich (BB code):
=IF(COUNT(CM32:CY32),INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)),"")
Otherwise:
Rich (BB code):
=IF(COUNTIF(CM32:CY32,"?*")+COUNT(CM32:CY32),
  INDEX(CM32:CY32,MATCH(TRUE,CM32:CY32<>"",0)),"")
 
Upvote 0

Forum statistics

Threads
1,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

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