Sumproduct with Matched Criteria an Extracted Text

Apple1

Board Regular
Joined
Jan 18, 2015
Messages
121
This is a Qn pertaining to


ABC
DEFG
1
2001
2001
200220022002CY-Q1
2SalesProfitSalesProfitSales
3James100069085591895
4Peter200075645601596
5Tom30005615203698
6Edwin40005615634563

<colgroup><col style="width:48pt" width="64" span="8"> </colgroup><tbody>
</tbody>

<tbody>
</tbody>

G3=SUMPRODUCT(($B$1:$E$1=mid(G1,3,4))*($B$2:$E$2=G2)*($B$3:$E$6))

Why doesn't this formula work?

Thank you
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Re: Sumporduct with Matched Criteria an Extracted Text

Do not discuss a problem you have in terms of non-working formulas. It's better for any would-be helper (including me) to have it in words. That said:

Is it the intention to use the 2002 bit of the condition given in G1?
 
Upvote 0
Re: Sumporduct with Matched Criteria an Extracted Text

Do not discuss a problem you have in terms of non-working formulas. It's better for any would-be helper (including me) to have it in words. That said:

Is it the intention to use the 2002 bit of the condition given in G1?

Hi

The problem lies with "mid(G1,3,4)". But I am using the formula within a formatted table where the header of the column will be in "CY...", so the formula will have to extract the Year from "CY.."

Thank you.
 
Upvote 0
Re: Sumporduct with Matched Criteria an Extracted Text

ABCDEF
G
H
1
20012001200220022002CY-Q1
2003CY-Q2
2SalesProfitSalesProfitSUMPRODUCT($B$3:$E$6*(($B$1:$E$1=mid(G1,3,4))*($B$2:$E$2=I1)))
SUMPRODUCT($B$3:$E$6*(($B$1:$E$1=mid(H1,3,4))*($B$2:$E$2=I1)))
3James100069085591895
4Peter200075645601596
5Tom30005615203698
6Edwin40005615634563

<tbody>
</tbody>

<tbody>
</tbody>


Specially refer to the above table for an Eg hwere the header are in "CY..". Thank you
 
Upvote 0
Re: Sumporduct with Matched Criteria an Extracted Text

Thus, it's the year from G1 which is one of the conditions...

In G3 enter:

=SUMPRODUCT($B$3:$E$6*((ISNUMBER(FIND($B$1:$E$1,$G1))*($B$2:$E$2=$G2))))

Note. Please do not propose yourself formula(s) for a problem you seek help for. Such is more often than not misleading about the problem itself.
 
Upvote 0
Re: Sumporduct with Matched Criteria an Extracted Text

Thus, it's the year from G1 which is one of the conditions...

In G3 enter:

=SUMPRODUCT($B$3:$E$6*((ISNUMBER(FIND($B$1:$E$1,$G1))*($B$2:$E$2=$G2))))

Note. Please do not propose yourself formula(s) for a problem you seek help for. Such is more often than not misleading about the problem itself.

Hi

This is a bit disappointing and time wasting. You clearly don't understand the problem.

Can someone else help to solve this problem?

Thank you
 
Upvote 0
Re: Sumporduct with Matched Criteria an Extracted Text

This is a bit disappointing and time wasting. You clearly don't understand the problem.

Hello Apple1, perhaps you noticed that Aladin is a MrExcel MVP and has 80,000+ posts here, I think it's unlikely he doesn't understand the problem.

I tried the formula that Aladin proposed, based on the setup you showed in your first post. The result I get is 16,202, which seems correct to me. Is that the result you wanted?
 
Upvote 0
Re: Sumporduct with Matched Criteria an Extracted Text

A
B
C
D
E
F
G
1
2001​
2001​
2002​
2002​
2002CY-Q1
2
SalesProfitSalesProfitSales
3
James
1000​
690​
8559​
1895​
16202​
4
Peter
2000​
756​
4560​
1596​
16202​
5
Tom
3000​
56​
1520​
3698​
6
Edwin
4000​
56​
1563​
4563​

<tbody>
</tbody>

G3=SUMPRODUCT((B2:E2=G2)*((LEFT(G1,4)+0=B1:E1))*(B3:E6))

other solution

G4=SUMPRODUCT((B2:E2=G2)*((SUBSTITUTE(G1,"CY-Q1","")+0=B1:E1))*(B3:E6))
 
Upvote 0

Forum statistics

Threads
1,215,648
Messages
6,126,007
Members
449,280
Latest member
Miahr

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