sum specific values in a cell using criteria

AriannaVV

New Member
Joined
Aug 6, 2017
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi everyone. I need help to built a formula to sum specific values in a cell, if this is possible. Let me explain this better.

In a cell, let's say A1, I have the following narratives:
01.08.2023 / 2 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 8 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault. Is it possible to sum in different cells the issues caused by bad weather and the issues cause by driver's fault? I'm using excel 365. Thank you so much for any help provided.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How about this?

Excel
ABCDEF
101.08.2023 / 2 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 8 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault.
2
301.08.20232caused by bad weather6
402.08.20232caused by drivers' fault
503.08.20238caused by bad weather
604.08.20234caused by drivers' fault.
Sheet2
Cell Formulas
RangeFormula
A3:C6A3=TEXTSPLIT(A1,{" / "," issues "},", ")
F3F3=SUM(IFERROR(FIND("driver",C3:C6)>0,0)*B3:B6)
Dynamic array formulas.
 
Upvote 0
Or in 1 cell.

Excel
ABC
101.08.2023 / 2 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 8 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault.6
Sheet2
Cell Formulas
RangeFormula
C1C1=LET(ts,TEXTSPLIT(A1,{" / "," issues "},", "),SUM(IFERROR(FIND("driver",INDEX(ts,,3))>0,0)*INDEX(ts,,2)))
 
Upvote 0
Or in 1 cell.

Excel
ABC
101.08.2023 / 2 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 8 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault.6
Sheet2
Cell Formulas
RangeFormula
C1C1=LET(ts,TEXTSPLIT(A1,{" / "," issues "},", "),SUM(IFERROR(FIND("driver",INDEX(ts,,3))>0,0)*INDEX(ts,,2)))
Thank you for your reply. The second solution seems to work ok, but i have a problem. The result of the formula is 0 because it can't sum the numbers. They appear as text. Any ideas how to overcome this?
 
Upvote 0
I thought that you might be after something like this? (Punctuation may possibly cause further issues)

23 08 29.xlsm
ABC
1bad weatherdrivers' fault
201.08.2023 / 2 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 8 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault.106
301.08.2023 / 0 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 0 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault, 05.08.2023 / 204 issues caused by drivers' fault.0210
Sums
Cell Formulas
RangeFormula
B2:C3B2=LET(ts,TRIM(TEXTSPLIT($A2,{"/",",","."})),f,FILTER(ts,RIGHT(ts,LEN(B$1))=B$1),SUM(--LEFT(f,FIND(" ",f))))
 
Upvote 1
Solution
I thought that you might be after something like this? (Punctuation may possibly cause further issues)

23 08 29.xlsm
ABC
1bad weatherdrivers' fault
201.08.2023 / 2 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 8 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault.106
301.08.2023 / 0 issues caused by bad weather, 02.08.2023 / 2 issues caused by drivers' fault, 03.08.2023 / 0 issues caused by bad weather, 04.08.2023 / 4 issues caused by drivers' fault, 05.08.2023 / 204 issues caused by drivers' fault.0210
Sums
Cell Formulas
RangeFormula
B2:C3B2=LET(ts,TRIM(TEXTSPLIT($A2,{"/",",","."})),f,FILTER(ts,RIGHT(ts,LEN(B$1))=B$1),SUM(--LEFT(f,FIND(" ",f))))
Τhis is exaclty what I was looking for. Thank you very much. Works great. Ideed I have some issues with the punctuation (it's not same in all cases) but I solve it by making some changes in the text. Thanks again!!!
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,273
Messages
6,123,987
Members
449,137
Latest member
abdahsankhan

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