Sumifs where string contains two separate cell references sequentially

DobsonW

New Member
Joined
Jan 5, 2018
Messages
2
Hi,

can anyone help me with the below:

  • I have delimiter separated strings in column A
  • A value in column B
  • Two separate strings in two reference cells (C1 and D1)
  • I need to sum the values in column b where the string in column A contains first C1 then D1

I've so far tried =SUMIFS($A:$A,$B:$B,"*"&C1&"*"*"*"&D1&"*"

but this doesn't work.

If i was just counting if they both appeared in the string then no problem but D1 must come after C1

In the below i would expect the result to be 2

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]String[/TD]
[TD]Value[/TD]
[TD]one[/TD]
[TD]four[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="class: xl65, width: 179"]one >> two >> three >> four[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="class: xl65, width: 179"]one >> two >> four >> three[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="class: xl65, width: 179"]four >> two >> one >> three[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Book1
ABCDE
1StringValueonefour2
2one >> two >> three >> four1
3one >> two >> four >> three1
4four >> two >> one >> three1
Sheet1
Cell Formulas
RangeFormula
E1=SUMIF($A:$A,"*"&$C$1&"*"&$D$1&"*",$B:$B)


Is this right?

WBD
 
Upvote 0
A SUMIFS formula should work too...

In C2 enter, copy across, and down:

=SUMIFS($B$2:$B$4,$A$2:$A$4,"*"&C$1&"*")
 
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