Calculate number of hours worked in a month
I have one sheet where I am going to track the number of hours worked on a project. The individual will put the hours in and date worked. In a roll up sheet I am trying to calculate the number of hours worked per month
Sheet 1
Sheet 2
In column3 and am trying to add up the number of hours worked(used) for Dec 2020 and each month after.
Any help is greatly appreciated
Answers
-
This appears to be a format issue. Date format for a single cell isn't working. While my column on sheet 1 is formatted as date, I cannot format the reference cell on sheet 2 as a date so the formula is not working. I created another column, formatted as date and it works.
-
Yes, in order for the Date column in your first sheet to be recognized in a formula you would either need the referenced cell in your second sheet to also be in a Date Type of column, or you can use different functions in your formula to convert numbers into dates.
For example, you can search for a specific month by using the MONTH function and looking for a number.
December would be: MONTH(@cell) = 12
I would suggest wrapping this specific function in an IFERROR as well, in case it comes across blank cells.
IFERROR(MONTH(@cell), 0) = 12
Then you can use this as your criteria in a SUMIF statement (instead of referencing a cell):
=SUMIF({Date Column}, IFERROR(MONTH(@cell), 0) = 12, {Total Hours column})
You'll need to adjust it per-column to look for a different month, so for January:
=SUMIF({Date Column}, IFERROR(MONTH(@cell), 0) = 1, {Total Hours column})
Keep in mind this doesn't account for the Year, so I would suggest having an "archive" sheet where you can move rows that are no longer a part of your Sheet 2 calculations so that your formulas only look at the correct month/year.
Let me know if you have questions about this!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!