Formula to sum values based on an account number match but with spaces at the beginning of the cell

danielv1985

New Member
Joined
Jul 15, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,

First time poster and really appreciate any help.

I'm struggling to compose the formula to sum the total based on an account character match.

1689478017450.png


The text in B176 has 5 spaces before the digits commence.

I need to sum the values from the below table (same tab) but the digits commence at the beginning of the cell i.e. no spaces

Note, only the digits match - not the subsequent description.

1689478119015.png


Thank you,
Daniel
 

Attachments

  • 1689477699567.png
    1689477699567.png
    5 KB · Views: 4
  • 1689477811031.png
    1689477811031.png
    20.2 KB · Views: 4
  • 1689477851240.png
    1689477851240.png
    5.3 KB · Views: 4
  • 1689477891483.png
    1689477891483.png
    9.2 KB · Views: 4
  • 1689477980719.png
    1689477980719.png
    24.5 KB · Views: 3

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Column B appears to start with the "product number". If leading spaces are causing a problem use the TRIM function.
Please provide your formula from you cells or columns where the product number with leading spaces is causing the problem

=TRIM("B176") should fix your problem

your modified function should be something like the following
=SUM( .....TRIM("B176") ...)

Again if you provide your actual formula I can give you a complete formula fix.
 
Upvote 0
To clarify my response
Replace references to your product like
B176
with
TRIM(B176)
 
Upvote 0
Something like this:
Book1
BC
175Telecommunications
176
177 66214001 - telephone2,812
Sheet1
Cell Formulas
RangeFormula
C177C177=SUMIF($B$227:$B$231,LEFT(TRIM(B177),8)&"*",$C$227:$C$231)
 
Upvote 0

Forum statistics

Threads
1,215,119
Messages
6,123,172
Members
449,094
Latest member
bes000

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