Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUMIF Formula w/ OR Criteria | Excel Discussion (Misc queries) | |||
Variable criteria formula | Excel Worksheet Functions | |||
2 Criteria Formula | Excel Discussion (Misc queries) | |||
frequency formula with criteria | Excel Worksheet Functions | |||
2 criteria for a COUNTIF formula? | New Users to Excel |