ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SumProduct - With Or Function (https://www.excelbanter.com/excel-worksheet-functions/249646-sumproduct-function.html)

Benjamin

SumProduct - With Or Function
 
=SUMPRODUCT(--(A1:A24="Tom"),--(B1:B24="May"),--(C1:C24))
First Array (Names) & Second Array (Months) and Third Array is numbers to
sum up.

Now I can easily add up all the expenses for each employee for the month, as
the employee and month are likely to have multiple entries, on more than one
row for instance.

But Now I want to do it for the quarter. So If it's X Employee and either
Jan, Feb, Mar, or April, Sum Amounts.....

I could probably write a really long formula to do that... is there a good
and concise way to do that... so someone after me could actually tell what
I'm doing with this formula.

Ms-Exl-Learner

SumProduct - With Or Function
 
Construct your formula like this...

=SUMPRODUCT((A1:A24="Tom")*(ISNUMBER(MATCH(B1:B24, {"Jan","Feb","Mar","Apr"},0)))*(C1:C24))

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"Benjamin" wrote:

=SUMPRODUCT(--(A1:A24="Tom"),--(B1:B24="May"),--(C1:C24))
First Array (Names) & Second Array (Months) and Third Array is numbers to
sum up.

Now I can easily add up all the expenses for each employee for the month, as
the employee and month are likely to have multiple entries, on more than one
row for instance.

But Now I want to do it for the quarter. So If it's X Employee and either
Jan, Feb, Mar, or April, Sum Amounts.....

I could probably write a really long formula to do that... is there a good
and concise way to do that... so someone after me could actually tell what
I'm doing with this formula.


Teethless mama

SumProduct - With Or Function
 
=SUMPRODUCT((A1:A24="Tom")*(B1:B24={"Jan","Feb","M ar","Apr"})*C1:C24)


"Benjamin" wrote:

=SUMPRODUCT(--(A1:A24="Tom"),--(B1:B24="May"),--(C1:C24))
First Array (Names) & Second Array (Months) and Third Array is numbers to
sum up.

Now I can easily add up all the expenses for each employee for the month, as
the employee and month are likely to have multiple entries, on more than one
row for instance.

But Now I want to do it for the quarter. So If it's X Employee and either
Jan, Feb, Mar, or April, Sum Amounts.....

I could probably write a really long formula to do that... is there a good
and concise way to do that... so someone after me could actually tell what
I'm doing with this formula.


David Biddulph[_2_]

SumProduct - With Or Function
 
If your 3rd array is numbers, you don't need the double unary minus in front
of it. C1:C24 should do instead of --(C1:C24)
--
David Biddulph

"Benjamin" wrote in message
...
=SUMPRODUCT(--(A1:A24="Tom"),--(B1:B24="May"),--(C1:C24))
First Array (Names) & Second Array (Months) and Third Array is numbers to
sum up.

Now I can easily add up all the expenses for each employee for the month,
as
the employee and month are likely to have multiple entries, on more than
one
row for instance.

But Now I want to do it for the quarter. So If it's X Employee and either
Jan, Feb, Mar, or April, Sum Amounts.....

I could probably write a really long formula to do that... is there a good
and concise way to do that... so someone after me could actually tell what
I'm doing with this formula.





All times are GMT +1. The time now is 04:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com