Index Function that Returns 0's AND Blanks

thestranger66

New Member
Joined
Nov 11, 2015
Messages
22
Hi Everyone,

I am in need of an INDEX function that is capable of returning both blanks and zeros from a column of data. Normally an when and INDEX function comes across a blank it returns a "0". A lot of people on the forums seem to devise solutions to similar problems using IF statements where all 0's are replaced with ""'s, but that doesn't work in my case since the data I want to be returning may contain both zeros and blanks. Below is a sample input and output that should clarify what I am trying to accomplish.

1 -> 1
2 -> 2
3 -> 3
0 -> 0
4 -> 4
""-> ""
5 -> 5
6 -> 6

Thanks in advance!
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
=INDEX($A$1:$A$8,ROWS($D$1:D1))

entered in D1 and copied down, will read A6 as 0 as designed. If A6 is to contain a formula blanks (i.e. ""), INDEX will read it as such. COUNTA(D6) will yield 1.

If you want to make INDEX read an empty, unused cell as if it were a formula blank, in E1 enter and copy down:

=INDEX($A$1:$A$8,ROWS($E$1:E1))&""

which would convert any true number into text and an empty cell into text (a formula blank).
 
Upvote 0
Glad you got solution, but as Aladin said the result of that formula is a TEXT string, not a real number.

When you really need to differenciate between Blank and a True Zero value, you may have to do this.

=IF(INDEX(MATCH(..))="","",INDEX(MATCH(..)))

Or maybe
=IFERROR((INDEX(MATCH(..)&"")+0,"")
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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