Summing multiple lines based off of date in single cell?

JustS0meGuy

New Member
Joined
Jul 16, 2019
Messages
2
Hello,
I have to do these tedious time sheets everyday. I'm trying to spend some upfront time to hopefully same me time in the long run. Below is a link to an example file.

I found code to get unique project numbers from the list, but I can't figure out how to sort them (yellow column)

With the format used, the date is only entered once for the entire day. As a result I can't figure out a non-VBA way to sum the hours under the red highlighted area. I can't figure out a good VBA approach with my (very) limited skills. Would any of you kind VBA kung-fu masters be able to assist?


https://www.dropbox.com/sh/s9khekp5rtear4p/AAAozJv4tiJE2lpKuNAJp8d7a?dl=0
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi & welcome to MrExcel.
This will fill in the dates in col A, so you can then use SUMIFS in cols F:L
Code:
Sub Justsomeguy()
   With Range("B5", Range("B" & Rows.Count).End(xlUp))
      .SpecialCells(xlConstants).Offset(, -1).SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
   End With
End Sub
 
Upvote 0
Thanks for getting back to me! This works great for the formatting issue. This sheet is used by others so I knew entering the date for every line wouldn't be a problem for me but getting others to be consistent would be the issue.

The next task is the SUMIFS. I’m going to try to put the basic =SUMIF in each cell, but I’ve had issues in the past with Excel getting angry about too many formulas testing too many conditions. If I have an issue my next idea was to put a VBA SUMIF code that would loop through the table and populate each cell. My thought is using the VBA would make it so Excel was only doing hard work when requested as opposed to having the basic =SUMIF functions all firing at the same time whenever anything is updated in the workbook. Any thoughts on which would be better?
 
Upvote 0
I would stick with SUMIFS like
=SUMIFS($B$5:$B$17,$A$5:$A$17,F$4,$C$5:$C$17,$E5)
This will only recalculate if the data in A5:C17 changes, or if the criteria cells change
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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