Extract middle partial text then summing a range based on met criteria

Wiryeman

New Member
Joined
Jun 25, 2008
Messages
5
Greetings,

I am trying to sum a range based on a partial middle text criteria in the adjoining range. e.g.

in Column A | Column B

6300104 - Beauty | 100
6300105 - is in | 200
6300106 - the | 50
6700104 - eye of | 100
6700106 - the | 75
6800104 - beholder | 25

So I want to sum cells the have the partial string of >=104 and <=105 so in this example I would get a total sum of 425

Thanks
Jeff
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Give this formula a try...

=SUMPRODUCT(C1:C6,--(0+MID(A1:A6,5,3)>=104),--(0+MID(A1:A6,5,3)<=105))
 
Upvote 0
Hi, Rick, do you mean you need to use another formula in column C,then use your Sumproduct ?
 
Upvote 0
If you have column C , and want to sum all number in C only.

=SUMPRODUCT((RIGHT(A1:A6,3)-0>103)*(RIGHT(A1:A6,3)-0<106)*C1:C6)
 
Upvote 0
Hi, Rick, do you mean you need to use another formula in column C,then use your Sumproduct ?
No, I made a mistake and posted my test case (Column A's text covered Column B and instead of widening Column A so it did not overlap Column B, I simply typed the numbers to be added into Column C instead of Column B). The formula I should have posted was this one...

=SUMPRODUCT(B1:B6,--(0+MID(A1:A6,5,3)>=104),--(0+MID(A1:A6,5,3)<=105))

Sorry for any confusion my original message may have caused.

Note: For clarification, using the first data row as an example, I assume cell A1 contained "6300104 - Beauty" and cell B1 contained 100.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,586
Messages
6,131,571
Members
449,655
Latest member
Anil K Sonawane

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