Adding cells with numbers and a letter designation to specific cells

GHOSTOF309

New Member
Joined
Jun 7, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am somewhat of a novice at Excel but have been dabbling in it over the past few years learning on my own.
I have made monthly report for employees at work to include rows of cells for hours worked each day and time off used each day (vacation, personal, sick, etc). If you see in the first picture below, duty hours will always just be a number equalling the number of hours worked. The "other" hours would be listed as the number of hours taken off of work along with a letter indicating what type of time was used to take off... ex: 4 hours vacation time would be 4V, 4 hours personal time would be 4P and so on. I have figured out the macro that I needed to be able to add cells that include text using sum_only_numbers which works well for adding horizontally and vertically.
At the bottom of my worksheet i have cells for the total amount of Vacation, Personal, Sick time etc. used for the month. I am trying to figure out how to make a formula for each cell under Personal, Sick, Vacation etc in picture #2 to add the cells in picture #1 automatically determined by the letter used 4P, 4V, 4S etc. I have found numerous formulas but none seem to work.
Thanks in advance for any and all assistance.
monthly clip.PNG

Monthly clip2.PNG
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about something like the following (which also doesn't use VBA for the total line):

Book1
ABCDEFGHIJ
1Shift
2Duty133 E
3Other10 S2 V2 S24 V
4Other1 S2 S5 S4 V
5Total1120220583
6
7
8S - SickE- EducationV - Vacation
920310
Sheet3
Cell Formulas
RangeFormula
B5:J5B5=SUM(IFERROR(0+TEXTBEFORE(B2:B4," "),0))
B9:D9B9=SUM(IFERROR(0+TEXTBEFORE($B$2:$J$5," "&LEFT(B8,1)),0))


Made an edit for 2-digit number possibilities.
 
Last edited:
Upvote 0
Sorry about the error in previous post (#2). I think think this is now correct and has the total for each row.

Book1
ABCDEFGHIJK
1ShiftTOTAL
2Duty133 E7
3Other10 S2 V2 S24 V20
4Other1 S2 S5 S4 V12
5Total112032558339
6
7
8S - SickE- EducationV - Vacation
920310
Sheet3
Cell Formulas
RangeFormula
K2:K4K2=SUM(IFERROR(ISNUMBER(B2:J2)*B2:J2,0))+SUM(IFERROR((0+TEXTBEFORE(B2:J2," ")),0))
B5:K5B5=SUM(IFERROR(ISNUMBER(B2:B4)*B2:B4,0))+SUM(IFERROR(0+TEXTBEFORE(B2:B4," "),0))
B9:D9B9=SUM(IFERROR(0+TEXTBEFORE($B$2:$J$5," "&LEFT(B8,1)),0))
 
Upvote 0
Solution
Sorry about the error in previous post (#2). I think think this is now correct and has the total for each row.

Book1
ABCDEFGHIJK
1ShiftTOTAL
2Duty133 E7
3Other10 S2 V2 S24 V20
4Other1 S2 S5 S4 V12
5Total112032558339
6
7
8S - SickE- EducationV - Vacation
920310
Sheet3
Cell Formulas
RangeFormula
K2:K4K2=SUM(IFERROR(ISNUMBER(B2:J2)*B2:J2,0))+SUM(IFERROR((0+TEXTBEFORE(B2:J2," ")),0))
B5:K5B5=SUM(IFERROR(ISNUMBER(B2:B4)*B2:B4,0))+SUM(IFERROR(0+TEXTBEFORE(B2:B4," "),0))
B9:D9B9=SUM(IFERROR(0+TEXTBEFORE($B$2:$J$5," "&LEFT(B8,1)),0))
KWEAVER - YOU ARE MY FAVORITE PERSON TODAY! IT WORKED! THANK YOU VERY MUCH, I HAVE BEEN PULLING MY HAIR OUT WITH THIS.
 
Upvote 0
Glad it all worked for you. Hope you still have some hair.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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