Formula to calculate total days in a column.

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,286
Office Version
  1. 2013
Platform
  1. Windows
Good Day.
How can we calculate the total number of days in a column with a formula?
Thanks.



4
Date
22-Aug-2024
22-Aug-2024
23-Aug-2024
23-Aug-2024
23-Aug-2024
23-Aug-2024
23-Aug-2024
24-Aug-2024
24-Aug-2024
24-Aug-2024
24-Aug-2024
24-Aug-2024
24-Aug-2024
24-Aug-2024
25-Aug-2024
25-Aug-2024
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If the example is representative (you have a contignous set of days, just some are repeated, and dates are excel dates, not texts, which only look like a date), such formula shall be enough:

Excel Formula:
=max(A1:A100)-min(A1:A100)+1

if you receive as a result something that looks like a date change cell format to General or Number (Formatting may be needed, as Excel tends to return formula values in date format if dates are in formula data range).
 
Upvote 0
Solution
I am assuming that you want to count the number of unique days in your column, and the days may or may not be continuous.

It is too bad that you are still using Excel 2013 and not 2021 or 365, where you could use the new UNIQUE function.
The formula would just then be (for an example range A1:A10)
Excel Formula:
=COUNTA(UNIQUE(A1:A10))

With older version of Excel, you could use:
Excel Formula:
=SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10))
as described here: Count unique values in a range with COUNTIF
 
Upvote 0
If the example is representative (you have a contignous set of days, just some are repeated, and dates are excel dates, not texts, which only look like a date), such formula shall be enough:

Excel Formula:
=max(A1:A100)-min(A1:A100)+1

if you receive as a result something that looks like a date change cell format to General or Number (Formatting may be needed, as Excel tends to return formula values in date format if dates are in formula data range).
Thx.
 
Upvote 0

Forum statistics

Threads
1,223,923
Messages
6,175,389
Members
452,640
Latest member
steveridge

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