Inclusive Date Range

F

Fellow

I'm creating a spreadsheet to help calculate the split on rent and
utilities.
The method I'm using to split things up requires a calculation using
the number of days in a billing period.

Let's say A2 holds the period start date and B2 holds the period end
date.
June 1 - June 30 will be our arbitrary billing period.
That period contains 30 days, but using a formula like this
=B2-A2
would return 29 days because it's calculating the difference, whereas
I want the inclusive span.

What I ended up doing was changing the formula to
=B2-A2+1
which works, but I'm wondering if there isn't a more elegant way to do
this.

Is there?
 
D

Dave Peterson

That looks very elegant/natural to me.
I'm creating a spreadsheet to help calculate the split on rent and
utilities.
The method I'm using to split things up requires a calculation using
the number of days in a billing period.

Let's say A2 holds the period start date and B2 holds the period end
date.
June 1 - June 30 will be our arbitrary billing period.
That period contains 30 days, but using a formula like this
=B2-A2
would return 29 days because it's calculating the difference, whereas
I want the inclusive span.

What I ended up doing was changing the formula to
=B2-A2+1
which works, but I'm wondering if there isn't a more elegant way to do
this.

Is there?
 
F

Fellow

That is the way to do it if you don't want the difference.

--
__________________________________
HTH

Bob

Cool, that's great.
I just thought maybe there's already a function for this.

Thanks, folks!

-Fellow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top