Sum cells with numbers and text

tabbytomo

New Member
Joined
Jun 23, 2016
Messages
18
Hi everyone, I'm working on a shift planner that will include cells with numbers and text. I want to sum the numbers of these cells that have numbers and text.

My shift patterns will follow a strict criteria. Where X is a number:
Example 1: X Standard
Example 2: X Standard X Lower
Example 3: X Standard X Lower X Upper

I have Q2:S2 summing the contents of I2:O2, however my formula does not work for the second or third example and as I say I don't yet know enough to make a formula that works for that.

The formula I'm using in Q2:S2 is:
Excel Formula:
=SUM(IF(ISNUMBER(FIND(U1,$I$2:$O$2)),VALUE(LEFT($I$2:$O$2,FIND(U1,$I$2:$O$2)-1)),0))

U2:U4 is my list of words, Standard, Lower and Upper.

Any help greatly appreciated!
 

Attachments

  • Example.png
    Example.png
    13.4 KB · Views: 26

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Place the text from U1:U3 in Q1, R1, S1 and try this in Q2 and spread it around:
Excel Formula:
=SUM(IFERROR(VALUE(MID($I2:$O2,IFERROR(SEARCH("?? "&Q$1,$I2:$O2,1),SEARCH("? "&Q$1,$I2:$O2,1)),2)),0))

2024-06-11 Book1.xlsx
ABCDEFGHIJKLMNOPQRS
1MondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayStandardLowerUpper
20800-20000700-1900 8 Standard 2 Lower 2 Upper12 Standard2022
38 Standard 2 Lower 4 Upper12 Lower8144
412 Lower 10 Standard5 Upper10125
5000
6000
7000
Sheet1
Cell Formulas
RangeFormula
Q2:S7Q2=SUM(IFERROR(VALUE(MID($I2:$O2,IFERROR(SEARCH("?? "&Q$1,$I2:$O2,1),SEARCH("? "&Q$1,$I2:$O2,1)),2)),0))


A remark: this will only work properly with 1 or 2 digit numbers
 
Last edited:
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,145
Members
452,615
Latest member
bogeys2birdies

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