A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum Vlookup where there are blanks



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2010, 05:06 PM posted to microsoft.public.excel.misc
KneeDown2Up
external usenet poster
 
Posts: 54
Default Sum Vlookup where there are blanks

Hi

Excel 2002 sp3.

I have a sheet which has 7 tables (one per day of the week) in which a
number of members of staff are listed. Not all the staff are in all of the
days. I have a summary table at the bottom which looks up the name in each
table and sums their totals. However, I get the infamous #NA where the lookup
can't match the criteria. How can I avoid this?

This is what I have (which works when the referrence cell is occupied);-


=IF(ISERROR(SUM(VLOOKUP(B115,mon1,4,FALSE),VLOOKUP (B115,tue1,4,FALSE),VLOOKUP(B115,weds1,4,FALSE),VL OOKUP(B115,thur1,4,FALSE),VLOOKUP(B115,fri1,4,FALS E),VLOOKUP(B115,sat1,4,FALSE),VLOOKUP(B115,sun1,4, FALSE))),"",SUM(VLOOKUP(B115,mon1,4,FALSE),VLOOKUP (B115,tue1,4,FALSE),VLOOKUP(B115,weds1,4,FALSE),VL OOKUP(B115,thur1,4,FALSE),VLOOKUP(B115,fri1,4,FALS E),VLOOKUP(B115,sat1,4,FALSE),VLOOKUP(B115,sun1,4, FALSE)))

Many thanks in advance.
  #2  
Old May 10th, 2010, 09:31 PM posted to microsoft.public.excel.misc
JLatham
external usenet poster
 
Posts: 1,896
Default Sum Vlookup where there are blanks

Try this formula instead:
=SUM(IF(ISNA(VLOOKUP(B115,mon1,4,FALSE)),0,VLOOKUP (B115,mon1,4,FALSE)),IF(ISNA(VLOOKUP(B115,tue1,4,F ALSE)),0,VLOOKUP(B115,tue1,4,FALSE)),IF(ISNA(VLOOK UP(B115,weds1,4,FALSE)),0,VLOOKUP(B115,weds1,4,FAL SE)),IF(ISNA(VLOOKUP(B115,thur1,4,FALSE)),0,VLOOKU P(B115,thur1,4,FALSE)),IF(ISNA(VLOOKUP(B115,fri1,4 ,FALSE)),0,VLOOKUP(B115,fri1,4,FALSE)),IF(ISNA(VLO OKUP(B115,sat1,4,FALSE)),0,VLOOKUP(B115,sat1,4,FAL SE)),IF(ISNA(VLOOKUP(B115,sun1,4,FALSE)),0,VLOOKUP (B115,sun1,4,FALSE)))

That wraps each individual VLOOKUP() in a test for #N/A and if the
individual VLOOKUP() fails, then a 0 is used as the value for just that one.

"KneeDown2Up" wrote:

Hi

Excel 2002 sp3.

I have a sheet which has 7 tables (one per day of the week) in which a
number of members of staff are listed. Not all the staff are in all of the
days. I have a summary table at the bottom which looks up the name in each
table and sums their totals. However, I get the infamous #NA where the lookup
can't match the criteria. How can I avoid this?

This is what I have (which works when the referrence cell is occupied);-


=IF(ISERROR(SUM(VLOOKUP(B115,mon1,4,FALSE),VLOOKUP (B115,tue1,4,FALSE),VLOOKUP(B115,weds1,4,FALSE),VL OOKUP(B115,thur1,4,FALSE),VLOOKUP(B115,fri1,4,FALS E),VLOOKUP(B115,sat1,4,FALSE),VLOOKUP(B115,sun1,4, FALSE))),"",SUM(VLOOKUP(B115,mon1,4,FALSE),VLOOKUP (B115,tue1,4,FALSE),VLOOKUP(B115,weds1,4,FALSE),VL OOKUP(B115,thur1,4,FALSE),VLOOKUP(B115,fri1,4,FALS E),VLOOKUP(B115,sat1,4,FALSE),VLOOKUP(B115,sun1,4, FALSE)))

Many thanks in advance.

  #3  
Old May 10th, 2010, 10:30 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default Sum Vlookup where there are blanks

If you put the tables in the same columns so that they're one underneath
another then a simple SUMIF will do what you want.

--
Biff
Microsoft Excel MVP


"KneeDown2Up" wrote in message
news
Hi

Excel 2002 sp3.

I have a sheet which has 7 tables (one per day of the week) in which a
number of members of staff are listed. Not all the staff are in all of the
days. I have a summary table at the bottom which looks up the name in each
table and sums their totals. However, I get the infamous #NA where the
lookup
can't match the criteria. How can I avoid this?

This is what I have (which works when the referrence cell is occupied);-


=IF(ISERROR(SUM(VLOOKUP(B115,mon1,4,FALSE),VLOOKUP (B115,tue1,4,FALSE),VLOOKUP(B115,weds1,4,FALSE),VL OOKUP(B115,thur1,4,FALSE),VLOOKUP(B115,fri1,4,FALS E),VLOOKUP(B115,sat1,4,FALSE),VLOOKUP(B115,sun1,4, FALSE))),"",SUM(VLOOKUP(B115,mon1,4,FALSE),VLOOKUP (B115,tue1,4,FALSE),VLOOKUP(B115,weds1,4,FALSE),VL OOKUP(B115,thur1,4,FALSE),VLOOKUP(B115,fri1,4,FALS E),VLOOKUP(B115,sat1,4,FALSE),VLOOKUP(B115,sun1,4, FALSE)))

Many thanks in advance.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.