Count Between Dates for Google Sheets

yessir

Board Regular
Joined
Jun 7, 2019
Messages
91
I'm looking for a formula that will be able to display the number of days between two dates. The formula would be in column C. Additionally for the third row since there's only one day I wouldn't an error to be displayed - I'd want it to be blank or display "0".

A B C
11/29/202211/30/20221
11/29/202211/30/20221
11/19/20220
11/19/202211/30/202211

Anything helps!
 
Last edited by a moderator:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
For row 2, the formula in C2 would be:
Excel Formula:
=IF(AND(A2>0,B2>0),B2-A2,0)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another possible option
Fluff.xlsm
ABC
1
229/11/202230/11/20221
329/11/202230/11/20221
419/11/20220
519/11/202230/11/202211
Data
Cell Formulas
RangeFormula
C2:C5C2=MAX(0,DAYS(B2,A2))
 
Upvote 0
I'm using google sheets. Is there a way to return a blank cell instead of "0"? I'm trying to compile averages as well and realized that the 0's skew that data
 
Upvote 0
To get a "blank" cell just change the final 0 in Joe's formula to ""
 
Upvote 0
In future questions about Sheet should be posted in the General Discussion & Other Applications section of the board.
And you need to make it clear that you are using Sheets.
I have done that for you this time.
They had originally posted it there, but there was no mention of Google Sheets, so I moved it to the Excel Questions forum.

yessir,
In addition to posting it in the "General Discussion & Other Applications" forum, please be sure to mention in your post somewhere (in the title and/or original question) that this is a "Google Sheets" discussion.

While this "General Discussion & Other Applications" forum is the place to post Google Sheets questions, it is not exclusively for Google Sheets questions.
So when posting to this forum, you should always mention what program you are asking about (especially since many people accidentally post Excel questions here too!).

Thanks
 
Upvote 0

Forum statistics

Threads
1,215,671
Messages
6,126,133
Members
449,294
Latest member
Jitesh_Sharma

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