Sum AM Amount

Geo Jul

Board Regular
Joined
Nov 19, 2022
Messages
125
Office Version
  1. 2016
Platform
  1. Windows
Dear All


I want to sum for month of January 2023 from time 8 AM till 1 PM (13: 00) Only​
I used the following formula =SUMPRODUCT((Sheet1!$A$4:$A$151>=DATE(2023,1,1)+TIME(8,0,0))*(Sheet1!$A$4:$A$151<=DATE(2023,1,1)+TIME(13,0,0))*(Sheet1!$B$4:$B$151))​
and =SUMIFS(Sheet1!$B$4:$B$151,Sheet1!$A$4:$A$151,">="&DATE(2023,1,1)+TIME(8,0,0),date,"<="&DATE(2023,1,1)+TIME(13,0,0))​
both of then gave me wrong result​
please need your help
Best REgards​
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Attachments

  • Screenshot (971).png
    Screenshot (971).png
    73.1 KB · Views: 4
Upvote 0
try this formula, tough to debug when I don't have the data but, I think this is correct

Excel Formula:
=SUMIFS(Sheet1!C3:C151, Sheet1!B3:B151, ">=" & (DATE(2023, 1, 1) + TIME(8, 0, 0)), Sheet1!B3:B151,  "<=" & (DATE(2023, 1, 1) + TIME(13, 0, 0)))
 
Upvote 0
try this formula, tough to debug when I don't have the data but, I think this is correct

Excel Formula:
=SUMIFS(Sheet1!C3:C151, Sheet1!B3:B151, ">=" & (DATE(2023, 1, 1) + TIME(8, 0, 0)), Sheet1!B3:B151,  "<=" & (DATE(2023, 1, 1) + TIME(13, 0, 0)))
many thanks for your reply and your time the expected result should read 9373 and your formula gave only date 01/01/2023 and the correct timing 460
I need to sum up if month of January 2023 and the time is from 8:00 AM till 13:00 PM
 
Upvote 0
This will give you the whole month

Excel Formula:
=SUMIFS(Sheet1!C3:C151, Sheet1!B3:B151, ">=" & (DATE(2023, 1, 1) + TIME(8, 0, 0)), Sheet1!B3:B151, "<=" & (DATE(2023, 1, 31) + TIME(13, 0, 0)))
 
Upvote 0
This will give you the whole month

Excel Formula:
=SUMIFS(Sheet1!C3:C151, Sheet1!B3:B151, ">=" & (DATE(2023, 1, 1) + TIME(8, 0, 0)), Sheet1!B3:B151, "<=" & (DATE(2023, 1, 31) + TIME(13, 0, 0)))
the result was 18511 which is wrong it should read 9373
 
Upvote 0
Yikes, OK.

Add this formula to column D

Excel Formula:
=IF(AND(B3>=DATE(YEAR(B3), MONTH(B3), DAY(B3)) + TIMEVALUE("8:00"), B3<=DATE(YEAR(B3), MONTH(B3), DAY(B3)) + TIMEVALUE("13:00")), "X","")

lets get the time value to show X if in the range

then use this
Excel Formula:
=SUMIFS(Sheet1!C3:C151, Sheet1!B3:B151, ">=" & (DATE(2023, 1, 1)), Sheet1!B3:B151, "<=" & (DATE(2023, 1, 31) ), D3:D151, "=X")
 
Upvote 0
Yikes, OK.

Add this formula to column D

Excel Formula:
=IF(AND(B3>=DATE(YEAR(B3), MONTH(B3), DAY(B3)) + TIMEVALUE("8:00"), B3<=DATE(YEAR(B3), MONTH(B3), DAY(B3)) + TIMEVALUE("13:00")), "X","")

lets get the time value to show X if in the range

then use this
Excel Formula:
=SUMIFS(Sheet1!C3:C151, Sheet1!B3:B151, ">=" & (DATE(2023, 1, 1)), Sheet1!B3:B151, "<=" & (DATE(2023, 1, 31) ), D3:D151, "=X")
Thank you for the formulas It sums all the "X" = 9116 and the sum should read 9373
i sorted all "X" and sum them, and it gave me 9373
 
Upvote 0

Forum statistics

Threads
1,215,147
Messages
6,123,297
Members
449,095
Latest member
Chestertim

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