View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Fred Smith[_4_] Fred Smith[_4_] is offline
external usenet poster
 
Posts: 2,389
Default Handling Dashes in IF statement

From what you've told us, it's as simple as checking for a dash, as in:
=IF(B51="-",NA(),B57)

The next question is: why have the Vlookup return a dash? Why not have it
return #N/A? That would save you a step.

Finally, is it really returning a dash, or is it something formatted as a
dash? Formatting won't change the underlying value. In your If statement,
you need to ignore formatting, and check for the value actually being
returned.

Regards,
Fred

"Ant" wrote in message
...
Hello,

I have a vlookup statement that, when the table is empty, it returns a -
(dash).

Dependant upon that vlookup cell, I have the following IF statement
=IF(B51="",NA(),B57)

The IF statement does not work because of the dashes, but I have tried
other
alternatives in the "" to recognise the dashes, but none work.

How do I modify the IF statement to recognise the dash as "no entry" and
return the N/A. Once the N/A is returned, a conditional format changes the
font colour to the same as the background. I am using the N/A to avoid my
graph showing the line at zero.

Thanks in advance.
Ant