 SOLVED

Highlighted

# Date calculation formula needed for daily pickup

Hello Experts,
I am looking for a formula that calculates daily numbers from check-in and check-out dates. I am aware of the basic formula that calculates the total number of days between two dates but what I need is a formula that breaks down the total number of days day by day.
For example: check-in: 5/1/10 Check-out: 5/5/19 equals 4 days. Now I need to break down the 4 days by the day like this:
5/1/19     5/2/19      5/3/19       5/4/19
1              1               1               1
Is there a formula that pulls from the check-in and check-out columns and automatically calculates the daily breakdown as shown above in separate columns? Attached is the file with process I need help with .

10 Replies
Highlighted

# Re: Date calculation formula needed for daily pickup

You may use in E2

`=IF((E\$1>=\$A2)*(E\$1<=\$B2),1,"")`

and drag it to entire range

Highlighted

# Re: Date calculation formula needed for daily pickup

It appears that the check-in date is included in, while the check-out date is excluded from, the calculation of total nights. Thus, the formula in E2, copied down rows and across columns, is:
=IF((E\$1>=\$A2)*(E\$1<\$B2),
1,””)
Highlighted
Solution

# Re: Date calculation formula needed for daily pickup

@Sergei BaklanThank you so much!

Highlighted

# Re: Date calculation formula needed for daily pickup

@TwifooThank you so much! It worked!

Highlighted

# Re: Date calculation formula needed for daily pickup

@TwifooHow can I use the formula you provided with a different date range? I tried to do it with a different date range but it is not working.

Thank you again

Highlighted

# Re: Date calculation formula needed for daily pickup

It depends upon the layout of your data. The formula always conforms to such layout but the logic would remain the same.
Highlighted

# Re: Date calculation formula needed for daily pickup

@Twifoo @Twifoo Thank you! Can you elaborate a bit further please. I have used the same formula but it just not working. What do you mean by "data layout" exactly? Do mind looking at the attachment with the new set of dates and the formula please? Thank you again.

Highlighted

# Re: Date calculation formula needed for daily pickup

Formula works (attached), what exactly is wrong?

Highlighted

# Re: Date calculation formula needed for daily pickup

@Sergei BaklanThank you! One thing I noticed is that when I copied the dates and formula that you sent back and pasted into a new spreadsheet, the formula did not work. But when I re-typed one of the check-in/check-out dates the formula worked all of a sudden. It's like the the dates were not recognized until I re-typed them manually. Do you know what that could be? Thanks again!

Highlighted

# Re: Date calculation formula needed for daily pickup

Perhaps you didn't fix the row with absolute reference or like. Most probably wrong combination of absolute/relative references in pasted formulas.