SUMIF based on a specific set of numbers in a text string

christrudeaucpa

New Member
Joined
Mar 8, 2016
Messages
2
Hello and thanks for your time.

I am attempting to create a SUMIF function that sums a set of values based on a specific spot in a text string.

Each value has a corresponding Item # made up of the following features:

Year Month Day State Program Code Location
15 01 01 MA BOC BOS

Here's the full text string in the cell for this example: 150101MABOCBOS

What I'm looking to do is Sum based on certain months, so in this case, I would need the SUMIF to find Item #s with 01, 02, 03 as a month. The month will always be located in the 3rd and 4th characters in the Item # text string.

Let me know if you'd like any further clarification. Any help would be appreciated.

Chris
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Maybe something like this?

Excel 2010
ABCD
1
2150101MABOCBOS16
3150201MABOCBOS2
4150301MABOCBOS3
5150401MABOCBOS4
6150501MABOCBOS5
7150601MABOCBOS6
8150701MABOCBOS7
9150801MABOCBOS8

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet11

Worksheet Formulas
CellFormula
D2=SUMPRODUCT(--(MID(A2:A9,3,2)>="01"),--(MID(A2:A9,3,2)<="03"),B2:B9)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
That worked great! Thank you very much Eric. You're a life (*read* time) saver!

I've always done strategic web searching for my Excel tips and tricks in the past, but this required some specific outreach. I'm happy to have had a successful attempt on this message board. Hopefully others can use this post for years to come!
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,340
Members
451,637
Latest member
hvp2262

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