Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default SUMIF or SUMPRODUCT?

The following formula is returning a 0 outcome:
=SUMPRODUCT(--('TB SAICMB'!B2:B1000="'Computer Sales"),--('TB SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech"),'TB SAICMB'!E2:E1000)


when using SUMIF I get the desired result but is missing one criteria range ('TB SAICMB'!B2:B1000="'Computer Sales"):
=SUMIF('TB SAICMB'!B2:B1000,C5,'TB SAICMB'!E2:E1000)


Can I adapt the SUMIF formula to include this range or am I going wring in
my SUMPRODUCT layout?

Regards

EricB

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default SUMIF or SUMPRODUCT?

EricB wrote:
The following formula is returning a 0 outcome:
=SUMPRODUCT(--('TB SAICMB'!B2:B1000="'Computer Sales"),--('TB SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech"),'TB SAICMB'!E2:E1000)


when using SUMIF I get the desired result but is missing one criteria range ('TB SAICMB'!B2:B1000="'Computer Sales"):
=SUMIF('TB SAICMB'!B2:B1000,C5,'TB SAICMB'!E2:E1000)


Can I adapt the SUMIF formula to include this range or am I going wring in
my SUMPRODUCT layout?

Regards

EricB



D2:D1000 can't equal both "Admin" and "Tech".
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default SUMIF or SUMPRODUCT?

Hi,

There are 2 things. You have an apostrophe before the C in Computer sales,
is that a typo. More importantly you are looking for "Admin" and "Tech" in
column D and it won't be both of those so every row will evaluate as zero.
What are you actually looking for in column D?

Mike

"EricB" wrote:

The following formula is returning a 0 outcome:
=SUMPRODUCT(--('TB SAICMB'!B2:B1000="'Computer Sales"),--('TB SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech"),'TB SAICMB'!E2:E1000)


when using SUMIF I get the desired result but is missing one criteria range ('TB SAICMB'!B2:B1000="'Computer Sales"):
=SUMIF('TB SAICMB'!B2:B1000,C5,'TB SAICMB'!E2:E1000)


Can I adapt the SUMIF formula to include this range or am I going wring in
my SUMPRODUCT layout?

Regards

EricB

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMIF or SUMPRODUCT?

The problem is he

--('TB SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech")

You're testing the same range for 2 different conditions. Since the same
range can't be both conditions at the same time you need to craft the
expression to say: D2:D1000 = Admin or Tech.

Try it like this (I'm leaving out the sheet name so be sure to add it):

=SUMPRODUCT(--(B2:B1000="'Computer
Sales"),(D2:D1000="Admin")+(D2:D1000="Tech"),E2:E1 000)

--
Biff
Microsoft Excel MVP


"EricB" wrote in message
...
The following formula is returning a '0' outcome:
=SUMPRODUCT(--('TB SAICMB'!B2:B1000="'Computer Sales"),--('TB
SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech"),'TB
SAICMB'!E2:E1000)


when using SUMIF I get the desired result but is missing one criteria
range ('TB SAICMB'!B2:B1000="'Computer Sales"):
=SUMIF('TB SAICMB'!B2:B1000,C5,'TB SAICMB'!E2:E1000)


Can I adapt the SUMIF formula to include this range or am I going wring in
my SUMPRODUCT layout?

Regards

EricB



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default SUMIF or SUMPRODUCT?

Hi Mike H

1) The apostrophe can be considered a typo. I'm re-writing a spreadsheet and
names will be corrected accordingly.
2) It is an either/or situation. In column D I need to count values under
Admin and/or Tech. Thus a This + That situation.

I was trying to avoid a situation where I need to us +PLUS: =SUMIF('TB
SAICMB'!B2:B1000,Admin,'TB SAICMB'!E2:E1000)+SUMIF('TB
SAICMB'!B2:B1000,Tech,'TB SAICMB'!E2:E1000)

At present Im counting under B, Computer Sales Column D reflects
division, Admin, Tech, etc. I need to restrict counting to the specifics
in D but multiple departments are possible as in this case.

Hope this clarifies.

EricB

Hi Mike H

1) The apostrophe can be considered a typo. I'm re-writing a spreadsheet and
names will be corrected accordingly.
2) It is a

"Mike H" wrote:

Hi,

There are 2 things. You have an apostrophe before the C in Computer sales,
is that a typo. More importantly you are looking for "Admin" and "Tech" in
column D and it won't be both of those so every row will evaluate as zero.
What are you actually looking for in column D?

Mike

"EricB" wrote:

The following formula is returning a 0 outcome:
=SUMPRODUCT(--('TB SAICMB'!B2:B1000="'Computer Sales"),--('TB SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech"),'TB SAICMB'!E2:E1000)


when using SUMIF I get the desired result but is missing one criteria range ('TB SAICMB'!B2:B1000="'Computer Sales"):
=SUMIF('TB SAICMB'!B2:B1000,C5,'TB SAICMB'!E2:E1000)


Can I adapt the SUMIF formula to include this range or am I going wring in
my SUMPRODUCT layout?

Regards

EricB



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default SUMIF or SUMPRODUCT?

Biff (T.Valko) has shown you how to do it with Sumproduct in his response.

Mike

"EricB" wrote:

Hi Mike H

1) The apostrophe can be considered a typo. I'm re-writing a spreadsheet and
names will be corrected accordingly.
2) It is an either/or situation. In column D I need to count values under
Admin and/or Tech. Thus a This + That situation.

I was trying to avoid a situation where I need to us +PLUS: =SUMIF('TB
SAICMB'!B2:B1000,Admin,'TB SAICMB'!E2:E1000)+SUMIF('TB
SAICMB'!B2:B1000,Tech,'TB SAICMB'!E2:E1000)

At present Im counting under B, Computer Sales Column D reflects
division, Admin, Tech, etc. I need to restrict counting to the specifics
in D but multiple departments are possible as in this case.

Hope this clarifies.

EricB

Hi Mike H

1) The apostrophe can be considered a typo. I'm re-writing a spreadsheet and
names will be corrected accordingly.
2) It is a

"Mike H" wrote:

Hi,

There are 2 things. You have an apostrophe before the C in Computer sales,
is that a typo. More importantly you are looking for "Admin" and "Tech" in
column D and it won't be both of those so every row will evaluate as zero.
What are you actually looking for in column D?

Mike

"EricB" wrote:

The following formula is returning a 0 outcome:
=SUMPRODUCT(--('TB SAICMB'!B2:B1000="'Computer Sales"),--('TB SAICMB'!D2:D1000="Admin"),--('TB SAICMB'!D2:D1000="Tech"),'TB SAICMB'!E2:E1000)

when using SUMIF I get the desired result but is missing one criteria range ('TB SAICMB'!B2:B1000="'Computer Sales"):
=SUMIF('TB SAICMB'!B2:B1000,C5,'TB SAICMB'!E2:E1000)

Can I adapt the SUMIF formula to include this range or am I going wring in
my SUMPRODUCT layout?

Regards

EricB

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default SUMIF or SUMPRODUCT?

Hello,

In this case a simple addition is ok but generally, if the OR criteria
can both be TRUE, wrap them with SIGN:

=SUMPRODUCT(--(B2:B1000="'Computer
Sales"),SIGN((D2:D1000="Admin")+(D2:D1000="Tech")) ,E2:E1000)

Regards,
Bernd
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMIF or SUMPRODUCT?

How can one cell contain *both* separate entries at the same time?

--
Biff
Microsoft Excel MVP


"Bernd P" wrote in message
...
Hello,

In this case a simple addition is ok but generally, if the OR criteria
can both be TRUE, wrap them with SIGN:

=SUMPRODUCT(--(B2:B1000="'Computer
Sales"),SIGN((D2:D1000="Admin")+(D2:D1000="Tech")) ,E2:E1000)

Regards,
Bernd



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default SUMIF or SUMPRODUCT?

Hello Biff,

I referred to OR criteria, not the same cells. If, for example, you
would need a logical OR on M1:M100 (Y indicating male persons) and on
B1:B100 (Y indicating blonde hair) and if you need to count persons
who are male OR blonde then you don't want to double count blonde AND
male persons.

So =SUMPRODUCT(("Y"=B1:B100)+("Y"=M1:M100)) would be wrong but
=SUMPRODUCT(SIGN(("Y"=B1:B100)+("Y"=M1:M100))) would be ok.

Regards,
Bernd
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMIF or SUMPRODUCT?

Ok, I see what you meant.

--
Biff
Microsoft Excel MVP


"Bernd P" wrote in message
...
Hello Biff,

I referred to OR criteria, not the same cells. If, for example, you
would need a logical OR on M1:M100 (Y indicating male persons) and on
B1:B100 (Y indicating blonde hair) and if you need to count persons
who are male OR blonde then you don't want to double count blonde AND
male persons.

So =SUMPRODUCT(("Y"=B1:B100)+("Y"=M1:M100)) would be wrong but
=SUMPRODUCT(SIGN(("Y"=B1:B100)+("Y"=M1:M100))) would be ok.

Regards,
Bernd



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumif or Sumproduct? Helpless in Colorado Excel Discussion (Misc queries) 12 April 16th 08 01:55 PM
Sumif/Sumproduct Help Peanut Excel Worksheet Functions 5 August 15th 07 03:43 PM
HELP !!! SUMIF or SUMPRODUCT Soultek Excel Discussion (Misc queries) 3 March 21st 07 03:30 PM
HELP Sumif or Sumproduct Cathy Excel Discussion (Misc queries) 1 March 15th 07 03:03 PM
SUMPRODUCT or SUMIF or ... nfbelo Excel Worksheet Functions 4 May 24th 05 06:34 PM


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

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

About Us

"It's about Microsoft Excel"