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

G00DNESS

Board Regular
Joined
Aug 6, 2014
Messages
59
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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
18,067
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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

G00DNESS

Board Regular
Joined
Aug 6, 2014
Messages
59
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

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
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,191,076
Messages
5,984,494
Members
439,893
Latest member
johnsboxftm

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
Top