Sum up concatenation values

default_name

Board Regular
Joined
May 16, 2018
Messages
138
Office Version
2016
Platform
Windows, MacOS
Hello,

Is there any way to sum up the numeric values of concatenations?

Example below.
The data displayed in cells A2:D2 are a result of some concatenations.
In cell E2 I would like to be able to sum up those concatenated values.
In this case, E2 should come up as 137 days.

Stipulations:
I cannot remove those concatenations in columns A:D.
I cannot use macros/VBA for this.

Is these any way this can be done? Thanks

ABCDE
1Step 1Step 2Step 3Step 4Total Days
25 days28 days103 days1 day
3
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

default_name

Board Regular
Joined
May 16, 2018
Messages
138
Office Version
2016
Platform
Windows, MacOS
Try

=SUMPRODUCT((LEFT(A2:D2,FIND(" ",A2:D2)))*1)

View attachment 15713
Thanks for the quick response.
I tried entering in that formula but it resulted in a #VALUE!

Perhaps it may help if I describe the formulas being used in the concatenated cells.
This is what is in cell A2.
Rich (BB code):
=CONCATENATE(COUNTIF(A5:A100,"*y*"),CHAR(10),"days")
 

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,829
Office Version
365, 2019, 2016
Platform
Windows
Here is a way using Power Query.

Book1
ABCDE
1Step 1Step 2Step 3Step 4Total
25 days28 days103 days1 day137
Sheet3


Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Total = Table.AddColumn(Source, "Total", each List.Sum(List.Transform(Record.FieldValues(_), each Int64.From(Text.Split(_," "){0}))))
in
    Total
 

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
6,468
Platform
MacOS

ADVERTISEMENT

Hmm appears to be the fact that you are using CHAR(10)!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
44,906
Office Version
365
Platform
Windows

ADVERTISEMENT

How about
+Fluff New.xlsm
ABCDE
1Step 1Step 2Step 3Step 4Total Days
25 days28 days103 days1 day137
Data
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(--(LEFT(A2:D2,FIND(CHAR(10),A2:D2)-1)))
 

default_name

Board Regular
Joined
May 16, 2018
Messages
138
Office Version
2016
Platform
Windows, MacOS
Try

=SUMPRODUCT(--(LEFT(A4:D4,FIND("d",A4:D4)-2)))
How about
+Fluff New.xlsm
ABCDE
1Step 1Step 2Step 3Step 4Total Days
25 days28 days103 days1 day137
Data
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(--(LEFT(A2:D2,FIND(CHAR(10),A2:D2)-1)))
I tried both of these formulas and they both result in a #VALUE!

Columns B:D contain options for both days and day (in the case of "1 day") like this:
Here is what is in B2.
Rich (BB code):
=IF((COUNTIF(B5:B100,"*y*")=1),CONCATENATE(COUNTIF(B5:B100,"*y*"),CHAR(10),"day"),CONCATENATE(COUNTIF(B5:B100,"*y*"),CHAR(10),"days"))
Could this be causing the issue? For day vs days consistency I can also make A2 look like B2:D2.
 

default_name

Board Regular
Joined
May 16, 2018
Messages
138
Office Version
2016
Platform
Windows, MacOS
SOLVED IT!
My actual spreadsheet had some columns with merged values.
I unmerged the columns and it all works perfectly.

Thanks Fluff and gaz_chops!
Also thank you to lrobbo314 for providing a vba option if it ever needed it.

You guys are awesome!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
44,906
Office Version
365
Platform
Windows
Glad you sorted it & thanks for the feedback.
Best advice is NEVER use merged cells. ;)
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,625
Messages
5,512,473
Members
408,899
Latest member
cve60069

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top