Which functions will work in this case?

ajrilo

New Member
Joined
Jan 29, 2021
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
I have 4 teams that committed to doing volunteer work throughout the year. I set up a calendar and want to track teams and hours buy placing a 4-2, 3-1, 2-4, on the calendar, the first number representing the team and the second number represents the hours. I formatted the cells in the calendar as text. what function do I use now so that excel can distinguish between all four teams ( the first number) and add the correct number of hours to the team totals at the bottom. I added the numbers manually and placed by the teams to demonstrate what I would like excel to do for me.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Welcome to the MrExcel forum!

Perhaps:

Book1
ABC
1Teams
24-2
33-1
42-4
54-11
61-1
7
8
9TeamHours
1011
1124
1231
13413
Sheet3
Cell Formulas
RangeFormula
C10:C13C10=SUMPRODUCT(--(LEFT("0"&A$2:A$20,2)+0=B10),(MID(A$2:A$20,3,9)&".0")+0)
 
Upvote 0
Welcome to the MrExcel forum!

Perhaps:

Book1
ABC
1Teams
24-2
33-1
42-4
54-11
61-1
7
8
9TeamHours
1011
1124
1231
13413
Sheet3
Cell Formulas
RangeFormula
C10:C13C10=SUMPRODUCT(--(LEFT("0"&A$2:A$20,2)+0=B10),(MID(A$2:A$20,3,9)&".0")+0)
Eric,

Thank you so much! what if a team only does a half hour, I entered 4-1.5 and got an error, what must I modify to not get an error?

Tony
 
Upvote 0
I had to get a little tricky to accommodate empty cells in your list, otherwise the formula would be a bit simpler. But I think this version should handle decimal places:

Book1
ABC
1Teams
24-2.5
33-1
42-4
54-11
61-1
7
8
9TeamHours
1011
1124
1231
13413.5
Sheet3
Cell Formulas
RangeFormula
C10:C13C10=SUMPRODUCT(--(LEFT("0"&A$2:A$20,2)+0=B10),("0"&MID(A$2:A$20,3,9))+0)
 
Upvote 0
Solution
I had to get a little tricky to accommodate empty cells in your list, otherwise the formula would be a bit simpler. But I think this version should handle decimal places:

Book1
ABC
1Teams
24-2.5
33-1
42-4
54-11
61-1
7
8
9TeamHours
1011
1124
1231
13413.5
Sheet3
Cell Formulas
RangeFormula
C10:C13C10=SUMPRODUCT(--(LEFT("0"&A$2:A$20,2)+0=B10),("0"&MID(A$2:A$20,3,9))+0)
Eric,

Again thank you, works like a dream!

Tony
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,384
Members
449,080
Latest member
Armadillos

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