View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default VLOOKUP and IF AND problem

Maybe you could just check to see how many numbers you have:

=if(count(f2:g2)<2,"",f2-g2)

or if you want to treate those "" as 0's:

=n(f2)-n(g2)



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?


--

Dave Peterson