Searching a string and returning a sum

cyd000

New Member
Joined
Sep 22, 2015
Messages
9
I am trying to sum by cost center and account. Where I have several different cost centers that can reference many accounts. I have about 40,000 line items that I need to sort and sum.

the string I am trying to reference looks like this:
262.503.06.00.000
111.503.06.00.000
353.503.06.00.000
262.501.01.00.000
111.501.01.00.000
353.501.01.00.000

The first 3 digits are the cost center (which determines if it is an operating expense, administrative or maintenance expense) and the next 3 are the account and the next 2 are the sub-account.

Is there a way to get Excel to look at the first 3 sets of numbers in the account number and then sum them by cost center?






<colgroup><col width="134"></colgroup><tbody>
[TD="width: 134"][/TD]

</tbody>
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I don't quite follow your logic....but have you considered using Text to Columns to split the data then use a Pivot Table to SUM / COUNT the accounts ???
 
Upvote 0
Let column A house cost center, etc. spacifying strings, B the values to sum.

If C2 houses 111, C3 262, etc., try...

=SUMIFS(B:B,A:A,C2&"*")

If C2 houses 111.503.06.00.000, etc. invoke...

=SUMIFS(B:B,A:A,LEFT(C2,3)&"*")
 
Upvote 0

Forum statistics

Threads
1,223,914
Messages
6,175,351
Members
452,638
Latest member
Oluwabukunmi

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