Excel SumProduct extract Delimited Text and Numbers and sum from array of text

jc983

New Member
Joined
Apr 23, 2015
Messages
2
Hi. I have names and numbers on a budget. Starting with A1 through A7 the text looks like this. There may be blanks as well.

Data
Bob-15
Jon-40
Bob-10
Bob-10

Jeff-35
Bob-10


I want a formula to summarize the hours by person on the array. Results to show this:

User Hours
Bob 45
Jon 40
Jeff 35

Is there a way to do this, maybe with SumProduct? I'm using Excel 2013. THanks!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Welcome to MrExcel.

Why don't you split your data into two columns using Text To Columns and - as the delimiter?
 
Upvote 0
Something like this:


Excel 2010
ABCD
1Data
2Bob-15Bob45
3Jon-40Jon40
4Bob-10Jeff35
5Bob-10
6
7Jeff-35
8Bob-10
Sheet1
Cell Formulas
RangeFormula
D2{=SUM(IFERROR(--SUBSTITUTE($A$2:$A$8,C2&"-",""),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.


Note - this will only work in the very specific circumstance that the name is followed by a hyphen.
 
Upvote 0
in B1
=IF(A1="",0,RIGHT(A1,LEN(A1)-FIND("-",A1)))

and copy down the column

in C1 going down
Bob
Jon
Jeff

in D1
=SUMPRODUCT((LEFT(A$1:A$7,3)=C1)*(B$1:B$7))
and copy down to D3

UPDATE: Go with Comfy's reply, it's much cleaner than mine
 
Upvote 0
Really appreciate the help! This is the first one I tried and it worked perfectly. Thanks everyone!

Something like this:

Excel 2010
ABCD
1Data
2Bob-15Bob45
3Jon-40Jon40
4Bob-10Jeff35
5Bob-10
6
7Jeff-35
8Bob-10

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

Array Formulas
CellFormula
D2{=SUM(IFERROR(--SUBSTITUTE($A$2:$A$8,C2&"-",""),0))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Note - this will only work in the very specific circumstance that the name is followed by a hyphen.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,951
Members
449,095
Latest member
nmaske

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