Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

In VLookup when I get a returned value of 0 can it be replaced with spaces

Experts,


In VLookup when I get a  match and there is no data I get 0, is there a way to change the 0 to spaces within the vlookup?
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can simply do this...

=VLOOKUP(A2,TABLE,2,0)&""

This will return blank value if the value is 0

Saurabh...
Avatar of Professor J
Professor J

use this version, pleae see attached.
Book1.xlsx
If you want to combine with iferror then it will look like...

=iferror(VLOOKUP(A2,TABLE,2,0)&"","")

Saurabh...
Heh Prof, hows it going?

Your suggestion could have issues. With your sample data the amount for a couple of months is zero so the correct result of the lookup would be zero but it gets converted to blank.

If the result of the lookup is blank it returns 0 which is what I think the OP is asking to resolve.

Cheers
Rob
Hello Rob,

long time no see :-)
all good here, having good time in summer holidays.  just floating around EE sometimes trying to solve some questions which most of the time hijacked by Saurabh :-)  just kidding

well, from what i understood from the OP's question is that if the result is zero then it should be converted to blank and that is what my formula in the attachment does i believe.
I get a  match and there is no data
you got this right Rob