Sumproduct multiple criteria

EvaCheng0404

New Member
Joined
Jul 25, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I want to use sumproduct with multiple criteria.
I have a cell A1 to enter a text e.g. aaa or any text.
How can I use mid function to find cells that refer to A1 in sumproduct formula.

Thanks
Eva
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I am not sure whether you are looking for a partial match (i.e. the cell contains a certain text) or complete match (the cell is equal to a certain text) but something like this?

Excel Formula:
= SUMPRODUCT((ISNUMBER(FIND("AAA",A1:A5)))*(B1:B5))

Excel Formula:
=SUMPRODUCT((A1:A5="AAA")*(B1:B5))
 
Upvote 0
I am not sure whether you are looking for a partial match (i.e. the cell contains a certain text) or complete match (the cell is equal to a certain text) but something like this?

Excel Formula:
= SUMPRODUCT((ISNUMBER(FIND("AAA",A1:A5)))*(B1:B5))

Excel Formula:
=SUMPRODUCT((A1:A5="AAA")*(B1:B5))
Thanks for your quick response

However, my formula as below that criteria 1 & 2 works.
But for criteria 3 I want to sum any record that has the text in P5 in J column, it returns 0
The formula only search the 1st-3rd records that match P5
=SUMPRODUCT(--($E$10:$E$10000=$P$1),--(LEFT(H$10:$H$10000,4)=$P$2),--(mid($J$10:$J$10000,1,3)=$P$5),$L$10:$L$10000)
 
Upvote 0
What is it that is in P5? If it is a text string, then you should go without double negative.
 
Upvote 0
Cell P5 : 212

J column
AW212xxxxx
212Awxxxxx
AAA212xxxx

L
1
2
3

If I use sumproduct(--(1st criteria),--(2nd criteria),--(Mid(J1:J3,1,3)=P5, L1:L3)

The formula returns 2 not 6
 
Upvote 0
I see. So test this:

Excel Formula:
=ISNUMBER(FIND(P5,J1:J3))

or this inside your formula:

Excel Formula:
--(ISNUMBER(FIND($P$5,$J$10:$J$10000)))
 
Last edited:
Upvote 0
I see. So test this:

Excel Formula:
=ISNUMBER(FIND(P5,J1:J3))

or this inside your formula:

Excel Formula:
--(ISNUMBER(FIND($P$5,$J$10:$J$10000)))[/CODE
[/QUOTE]

I see. So test this:

Excel Formula:
=ISNUMBER(FIND(P5,J1:J3))

or this inside your formula:

Excel Formula:
--(ISNUMBER(FIND($P$5,$J$10:$J$10000)))
Thanks
How about if cell P5 :AW
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top