View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default VLOOKUP and IF AND problem

I suspect that your VLOOKUP formula in G2 is actually returning " "
(i.e. a space) rather than "" when it returns a blank - check this out
and correct it. Your first IF formula should then work.

Hope this helps.

Pete

excelnewbie44 wrote:
I am trying to using the following function: =IF(AND(F20,G20),F2-G2,"") to
calculate the difference between F2 & G2 if there is a value in both, if not
I want it to return a blank cell. In the cell G2 I have a Vlookup function
that looks up values in a table, if there is not value for what it is looking
up I have it returning a blank answer. When I do this and it returns a blank
answer in G2, my answer to my equation gives me a #VALUE!. I have also tried
the following fuction: =IF(ISBLANK(F2),"",IF(ISBLANK(G2),"",F2-G2)) and this
returns the same answer. Any idea of how I can fix this problem?