Count Hotel Member Returns Within 30 or 90 Days in Excel
Question details
Count hotel member return stays within 30 or 90 days of checkout, optionally filtering by rate type.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A hotel has member check-in and checkout dates and wants to analyze subsequent stays.
- Observed behavior
- The desired result is a count of qualifying return events for each time window, with an option to filter by rate type.
Arrange the data with one row per stay, a consistent member ID, check-in date, checkout date, and rate type. Confirm that dates are stored as dates rather than text, and replace personal identifiers with anonymous IDs if sharing a sample.
Calculate Return Windows and Summarize Them in an Excel PivotTable
Use helper columns to flag the next stay after each checkout, then sum the flags by rate type or other categories.
This method counts return events, not unique members. It compares each checkout with the next check-in for the same member. A same-day return counts, and the 90-day total includes returns within 30 days.
The example uses column A for Member ID, B for Check-in, C for Checkout, and E for Rate Type. Columns D, F, G, and H are helper columns.
Select the full data range, choose Data > Sort, and sort first by Member ID and then by Check-in date, both ascending. Keep all columns together when sorting.
Enter Days to Return in D1. In D2, enter =IF(AND(A2<>"",A2=A3,ISNUMBER(C2),ISNUMBER(B3),B3>=C2),B3-C2,"") and fill down through the last stay. The formula leaves the result blank when there is no valid next stay for that member.
Enter 30-Day Return in F1 and 90-Day Return in G1. In F2, enter =IF(AND(ISNUMBER(D2),D2<=30),1,0). In G2, enter =IF(AND(ISNUMBER(D2),D2<=90),1,0). Fill both formulas down.
Enter Return Rate Type in H1. In H2, enter =IF(ISNUMBER(D2),E3,"") and fill down. This uses the rate type on the subsequent stay, not the preceding checkout.
Select the full range including the helper columns and choose Insert > PivotTable. Add 30-Day Return and 90-Day Return to Values and set both to Sum. Add Return Rate Type to Rows or Filters to view specific rates.

Count Hotel Return Stays in WPS Spreadsheet
Use WPS Spreadsheet formulas to calculate days between stays, flag 30-day and 90-day returns, and total the results.
- 1. Open and sort the data: Open the workbook in WPS Spreadsheet. Select the full table and use Data > Sort to sort by Member ID and then Check-in date, ascending.
- 2. Calculate the return interval: With Member ID in A, Check-in in B, and Checkout in C, enter =IF(AND(A2<>"",A2=A3,ISNUMBER(C2),ISNUMBER(B3),B3>=C2),B3-C2,"") in D2 and fill down.
- 3. Flag qualifying returns: Enter =IF(AND(ISNUMBER(D2),D2<=30),1,0) in F2 and =IF(AND(ISNUMBER(D2),D2<=90),1,0) in G2. Fill both formulas down.
- 4. Total or filter the results: Use =SUM(F2:F1000) and =SUM(G2:G1000) to total the flags, adjusting the ranges to include all rows. To filter by the return stay's rate type, enter =IF(ISNUMBER(D2),E3,"") in H2, fill down, and use a formula such as =SUMIF(H2:H1000,"Corporate",F2:F1000).

Frequently Asked Questions
Does the 90-day count include returns within 30 days?
Yes. The 90-day flag includes every valid return from day 0 through day 90. To count only days 31 through 90, subtract the 30-day total from the 90-day total.
How do I count members instead of return events?
In Excel, create a PivotTable with Add this data to the Data Model selected, filter the relevant return flag to 1, and add Member ID to Values. Choose Value Field Settings > Distinct Count if available in your Excel version.
Which stay's rate type is used for filtering?
The Return Rate Type helper column uses the rate on the subsequent check-in row. Add that column to the PivotTable's Filters or Rows area to filter or group by the return stay's rate.
Why is a return interval blank?
The formula leaves the interval blank if the next row has a different or missing member ID, a date is not numeric, or the next check-in is earlier than the current checkout. Check the sort order and source dates.
Can I share a sample without exposing guest information?
Replace names and other personal details with anonymous member IDs before sharing. Check the workbook contents and sharing link settings, including any visible OneDrive path or account name.




