Sumif Dates excluding some

mickeystanford_alumni

Board Regular
Joined
May 11, 2022
Messages
129
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
Hi everyone,

I am trying to sum various columns with values where the first column is a date column. However, what I want is to exclude certain value linked to certain dates. E.g.

A1 B1 C1
01/01/1990 50 50
02/01/1990 60 100
03/01/1990 70 10
04/01/1990 80 50
05/01/1990 90 70

I want to sum B1 and C1, but excluding for example 03/01/1990.

For simplication this is the example, however, there are like 20 dates I would like to exclude. So not sure if making an index in a way where I could choose all dates I want to exclude would make it easier. As if in the formula I have to choose one by one is a very very long formula.

Thank you.

M
 
Sorry, 1 last question. Will the times always be on the hour (10:00, 11:00, etc) or will the actual times be somewhere between the 2?

I've tried several methods that should work but they are not picking up the correct results. Due to the way that excel handles times 10:00 as a time in cell does not match correctly to the same time in a formula :rolleyes:

I'm going to keep looking at it but so far I've had about 10 different failures.
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Sorry, 1 last question. Will the times always be on the hour (10:00, 11:00, etc) or will the actual times be somewhere between the 2?
--> It will be always be in this format.

Its very tricky with this date+time format. What I did is to convert text to columns, so that I divide the date and time in a second column. However, with the filtering formula you sent, not really able to sum the "in between" two hours. So from 10:00-11:00.

Hopw the idea of text to columns makes it easier...tks sir
 
Upvote 0
Using text to columns, or a helper formula to split the date and time was something that crossed my mind, in all honesty it doesn't make any difference to the results, but it does make the formulas shorter and easier to write, although there is very little difference with this one. The formula below will work with the dates and times either in the same column, or split into separate columns.

If they are separate columns then the ranges in both HOUR() functions need to be changed to look at the time column instead of the dates.

Book1
ABCDEF
1Exclude
201/01/1990 09:0009:00:0033102/01/1990
301/01/1990 10:0010:00:00681803/01/1990
401/01/1990 11:0011:00:00628
501/01/1990 12:0012:00:008062
601/01/1990 13:0013:00:004356156
702/01/1990 09:0009:00:001637
802/01/1990 10:0010:00:0026
902/01/1990 11:0011:00:005812
1002/01/1990 12:0012:00:001391
1102/01/1990 13:0013:00:001772
Sheet1
Cell Formulas
RangeFormula
F6F6=SUM(C2:D11*ISNA(MATCH(INT(A2:A11),F2:F3,0))*((HOUR(A2:A11)=10)+(HOUR(A2:A11)=11)))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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