View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default vlookup ignoring empty cells

One way. Place the 4 vlookups, each in its own cell within a contiguous
range, say in A2:A5. Then you could use this expression in A6 to sum it up,
which will ignore the possible errors or text returned by any of the 4
vlookups:
=SUM(IF(ISNUMBER(A2:A5),A2:A5))

P/s: I'd think that you should review your vlookups to use an exact match,
viz: instead of: vlookup(D1,EmpList,2)
use: vlookup(D1,EmpList,2,0)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"art" wrote:
I would like to add two amount by using the vlookup, however one might be
empty, which causes the vlookup to return #Value error. How can I check if
one cell is empty then dont add that cell.

Lets say : A B C D
1 John 600 Mark
2 Mark 550 Jones
3 Marry 650
4 Jones 645

And in cell A6 I should have the formula
=(vlookup(D1,EmpList,2)+Vlookup(D2,EmpList,2)+Vloo kup(D3,EmpList,2)+Vlookup(D4,EmpList,2)

It should return the total amount and ignoring the cell that are empty.