Count cells based on dates

KNUMB

New Member
Joined
Mar 15, 2006
Messages
19
Office Version
  1. 365
Platform
  1. Windows
I hope to explain this properly for all, as I would like to total a column of cells based on a dates.

Ex. Cell A8 is 11/16/23 (which is passed today's date) and cell E8 is 100.
Cell A9 is 12/2/23 (in the future) and cell E9 is 100.

One cell at the bottom of the excel sheet will count the total numbers in column E based on older date and the other cell will count the total numbers in column E based on future dates.
 

Attachments

  • Screenshot 2023-11-27 140103.png
    Screenshot 2023-11-27 140103.png
    32.5 KB · Views: 8

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
sumif()
using today()
before and equal to today
=SUMIF(A2:A14,"<="&TODAY(),B2:B14)
after today
=SUMIF(A2:A14,">"&TODAY(),B2:B14)

the column in image is A and B - so is my example
change to column E

Book8
AB
1
211/10/231
311/12/231
411/14/231
511/16/231
611/18/231
711/20/231
811/22/231
911/24/231
1011/26/231
1111/28/2310
1211/30/2310
1312/2/2310
1412/4/2310
15
16shipped9
17waiting40
Sheet1
Cell Formulas
RangeFormula
B16B16=SUMIF(A2:A14,"<="&TODAY(),B2:B14)
B17B17=SUMIF(A2:A14,">"&TODAY(),B2:B14)


Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Solution
sumif()
using today()
before and equal to today
=SUMIF(A2:A14,"<="&TODAY(),B2:B14)
after today
=SUMIF(A2:A14,">"&TODAY(),B2:B14)

the column in image is A and B - so is my example
change to column E

Book8
AB
1
211/10/231
311/12/231
411/14/231
511/16/231
611/18/231
711/20/231
811/22/231
911/24/231
1011/26/231
1111/28/2310
1211/30/2310
1312/2/2310
1412/4/2310
15
16shipped9
17waiting40
Sheet1
Cell Formulas
RangeFormula
B16B16=SUMIF(A2:A14,"<="&TODAY(),B2:B14)
B17B17=SUMIF(A2:A14,">"&TODAY(),B2:B14)


Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
That was it! Thank you so much as I was trying conditional formatting and countifs and didn't get anywhere.
 
Upvote 0
One more question, If I wanted to add another thing to this formula such as counting only cells that say "box" or "crate" too, is it possible?
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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