Masking numbers

Ben51

New Member
Joined
Feb 29, 2016
Messages
14
Hi All,

I have the following problem...

I have many numbers in the following format associated with several costs:

A B C

06.01.01.01.01 £8000 £40000
06.01.01.01.02 £2000 £50000
06.01.01.02.01 £9000 £60000
06.01.01.03.01 £7000 £70000
06.01.02.01.01 £5000 £40000
06.01.02.01.02 £1000 £30000

I wish to be able to add up all the costs associated with codes beginning with 06.01.01.01
and
06.01.02
etc

Thanks Guys and Girls

Ben
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
A formula isn't difficult but you can split the last .xx into a new cell with text to columns fixed width, then have a pivot table or the subtotaler add up the groups.
 
Upvote 0
Unfortunately i am unable to edit column a containing the numbers, could you advise the formula you speak of please?
 
Upvote 0
Change the parsing point as you like:


Excel 2010
ABC
106.01.01.01.01800040000
206.01.01.01.02200050000
306.01.01.02.01900060000
406.01.01.03.01700070000
506.01.02.01.01500040000
606.01.02.01.02100030000
7
8
9
1006.01.01.011000090000
1106.01.02.01600070000
Sheet12
Cell Formulas
RangeFormula
B10=SUMPRODUCT((LEFT($A$1:$A$6,11)=$A10)*B$1:B$6)
 
Upvote 0
Change the parsing point as you like:


Excel 2010
ABC
106.01.01.01.01800040000
206.01.01.01.02200050000
306.01.01.02.01900060000
406.01.01.03.01700070000
506.01.02.01.01500040000
606.01.02.01.02100030000
7
8
9
1006.01.01.011000090000
1106.01.02.01600070000
Sheet12
Cell Formulas
RangeFormula
B10=SUMPRODUCT((LEFT($A$1:$A$6,11)=$A10)*B$1:B$6)
Using your layout, you can also put this simpler formula in cell B10 and copy it across and down...

=SUMIF($A$1:$A$6,$A10&"*",B$1:B$6)
 
Last edited:
Upvote 0
Could i expand on that formula to sum columns B and C (i actually have 10 columns) rather than summing individually?
 
Upvote 0
Could i expand on that formula to sum columns B and C (i actually have 10 columns) rather than summing individually?
With this layout...
ABCDEFGHIJKL
106.01.01.01.016679311982969416386888048505606452175181
206.01.01.01.027862894221369698552436254348346360087800
306.01.01.02.012756835033006457962287518404553319476035
406.01.01.03.017992891985524697315458927218455094594200
506.01.02.01.017762751219726681695585773399773492451967
606.01.02.03.027619729932759923363447467213240727619656
7
8
9
1006.01.01.01
1106.01.02.01
1206.01.01.03
1306.01.02.03
14

<colgroup><col style="width: 30px; font-weight: bold;"><col style="width: 100.8px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"></colgroup><tbody>
</tbody>

Put this formula in cell B10 and copy it down to cell B13...

=SUMPRODUCT((LEFT($A$1:$A$6,11)=$A10)*B$1:K$6)
 
Last edited:
Upvote 0
Just change the formula as below to suit your requirement :

=SUMPRODUCT(
(LEFT($A$1:$A$6,11)=$A10)*B$1:C$6) to add columns "B" and "C"
 
Upvote 0
Is there a way to make the 11 bit mask interactive dependent on the length.

SUMPRODUCT((LEFT($A$1:$A$6,11)=$A10)*B$1:C$6)

I've tried using the LEN function

SUMPRODUCT((LEFT($A$1:$A$6,(LEN(A10)))=$A10)*B$1:C$6)
 
Upvote 0
Yes, you can use the following :

=SUMPRODUCT((LEFT($A$1:$A$6,LEN(A10))=A10)*B$1:C$6)
 
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,861
Members
449,411
Latest member
adunn_23

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