Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Sum If Formula with 3 criteria

I need to create an array formula with 3 criteria. I have done it with 2
before, but I can't seem to get it to work with 3. I have to use the Sumif
array instead of the sumproduct because I need to have blank cells within my
table.

This is essentially the formula I have, but all it returns is n/a.

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500=A4))

where column A is region, B is product, C is month of sale, and D is price.

I've looked in the archive questions, but I can't find anything similar that
doesn't use sumproduct.

Can anyone help me?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Sum If Formula with 3 criteria

You are not summing, you are counting even though your formula is incorrect

=SUMPRODUCT(--(A6:A500=A1),--(B6:B500=A2),--(C6:C500=A3),--(D6:D500=A4))

will count but if you want to sum D6:D500 use

=SUMPRODUCT(--(A6:A500=A1),--(B6:B500=A2),--(C6:C500=A3),D6:D500)

if you want to sum D6:D500 but only those values equal to A4


=SUMPRODUCT(--(A6:A500=A1),--(B6:B500=A2),--(C6:C500=A3),--(D6:D500=A4),D6:D500)


--


Regards,


Peo Sjoblom


"Peanut" wrote in message
...
I need to create an array formula with 3 criteria. I have done it with 2
before, but I can't seem to get it to work with 3. I have to use the
Sumif
array instead of the sumproduct because I need to have blank cells within
my
table.

This is essentially the formula I have, but all it returns is n/a.

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500=A4))

where column A is region, B is product, C is month of sale, and D is
price.

I've looked in the archive questions, but I can't find anything similar
that
doesn't use sumproduct.

Can anyone help me?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Sum If Formula with 3 criteria

Your example doesn't make sense. You've got 4 criteria, and nothing to sum.
Unless the D6:D500 portion is the sum column and the =A4 is a typo? Or are
you actually trying to do a COUNT?

I don't see any reason why SUMPRODUCT wouldn't work in this case.

=SUMPRODUCT(--(A6:A500=A1),--(B6:B500=A2),--(C6:C500=A3),D6:D500)

Blank cells would have no adverse effects on this formula.

However, if you still want to use SUM, then try this:

=SUM(IF(A6:A500=A1,1,0)*IF(B6:B500=A2,1,0)*IF(C6:C 500=A3,1,0)*D6:D500)

Enter as an array. This option however, does cause a problem if a blank is
located in Column D.

HTH,
Elkar




"Peanut" wrote:

I need to create an array formula with 3 criteria. I have done it with 2
before, but I can't seem to get it to work with 3. I have to use the Sumif
array instead of the sumproduct because I need to have blank cells within my
table.

This is essentially the formula I have, but all it returns is n/a.

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500=A4))

where column A is region, B is product, C is month of sale, and D is price.

I've looked in the archive questions, but I can't find anything similar that
doesn't use sumproduct.

Can anyone help me?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Sum If Formula with 3 criteria

I am summing. I am summing the "price" or the sale according to the region,
product, and month. I have tried the sumproduct formula by myself as well as
exactly listed below - I can get it to work when I have the range exactly
what I have information available today, but as this worksheet is going to
grow, I can't keep modifying the formula to include a new line. I can't get
sumproduct to work when it is including blank cells - however, the sum(if(
array formula does work under those circumstances. Even though I need the
range to be from 6-500, my information is currently only 6-100.

I made a typo on the previous formula in giving the last item a criteria.
It should be like this:

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500))



"Elkar" wrote:

Your example doesn't make sense. You've got 4 criteria, and nothing to sum.
Unless the D6:D500 portion is the sum column and the =A4 is a typo? Or are
you actually trying to do a COUNT?

I don't see any reason why SUMPRODUCT wouldn't work in this case.

=SUMPRODUCT(--(A6:A500=A1),--(B6:B500=A2),--(C6:C500=A3),D6:D500)

Blank cells would have no adverse effects on this formula.

However, if you still want to use SUM, then try this:

=SUM(IF(A6:A500=A1,1,0)*IF(B6:B500=A2,1,0)*IF(C6:C 500=A3,1,0)*D6:D500)

Enter as an array. This option however, does cause a problem if a blank is
located in Column D.

HTH,
Elkar




"Peanut" wrote:

I need to create an array formula with 3 criteria. I have done it with 2
before, but I can't seem to get it to work with 3. I have to use the Sumif
array instead of the sumproduct because I need to have blank cells within my
table.

This is essentially the formula I have, but all it returns is n/a.

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500=A4))

where column A is region, B is product, C is month of sale, and D is price.

I've looked in the archive questions, but I can't find anything similar that
doesn't use sumproduct.

Can anyone help me?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Sum If Formula with 3 criteria

Nevermind. I figured it out on my own.





"Peanut" wrote:

I am summing. I am summing the "price" or the sale according to the region,
product, and month. I have tried the sumproduct formula by myself as well as
exactly listed below - I can get it to work when I have the range exactly
what I have information available today, but as this worksheet is going to
grow, I can't keep modifying the formula to include a new line. I can't get
sumproduct to work when it is including blank cells - however, the sum(if(
array formula does work under those circumstances. Even though I need the
range to be from 6-500, my information is currently only 6-100.

I made a typo on the previous formula in giving the last item a criteria.
It should be like this:

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500))



"Elkar" wrote:

Your example doesn't make sense. You've got 4 criteria, and nothing to sum.
Unless the D6:D500 portion is the sum column and the =A4 is a typo? Or are
you actually trying to do a COUNT?

I don't see any reason why SUMPRODUCT wouldn't work in this case.

=SUMPRODUCT(--(A6:A500=A1),--(B6:B500=A2),--(C6:C500=A3),D6:D500)

Blank cells would have no adverse effects on this formula.

However, if you still want to use SUM, then try this:

=SUM(IF(A6:A500=A1,1,0)*IF(B6:B500=A2,1,0)*IF(C6:C 500=A3,1,0)*D6:D500)

Enter as an array. This option however, does cause a problem if a blank is
located in Column D.

HTH,
Elkar




"Peanut" wrote:

I need to create an array formula with 3 criteria. I have done it with 2
before, but I can't seem to get it to work with 3. I have to use the Sumif
array instead of the sumproduct because I need to have blank cells within my
table.

This is essentially the formula I have, but all it returns is n/a.

=SUM(IF((A6:A500=A1)*(B6:B500=A2)*(C6:C500=A3),D6: D500=A4))

where column A is region, B is product, C is month of sale, and D is price.

I've looked in the archive questions, but I can't find anything similar that
doesn't use sumproduct.

Can anyone help me?



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 Formula w/ OR Criteria SJT Excel Discussion (Misc queries) 5 August 4th 06 05:00 PM
Variable criteria formula Brent Excel Worksheet Functions 4 February 28th 06 05:48 AM
2 Criteria Formula Coltsfan Excel Discussion (Misc queries) 6 January 16th 06 08:08 PM
frequency formula with criteria seanc Excel Worksheet Functions 8 November 13th 05 10:17 AM
2 criteria for a COUNTIF formula? aaronwexler New Users to Excel 6 September 3rd 05 10:13 AM


All times are GMT +1. The time now is 05:02 PM.

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

About Us

"It's about Microsoft Excel"