Matching dates in two different ranges

dsjovik

New Member
Joined
Aug 5, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi
First post in the forum.
I am using Excel 2016 and do not have access to all the new array and sequence formulas in later versions or Excel365.
I want to use basic functions in Excel and not e.g. Power Query as this is for another person will no advances skills for excel fil maintenance.

Case:
I am booking a hotel stay from Date X to Date Y
The hotel has various discount periods from Date A - Date B, then another from Date C to Date D and so on.
I want to find out how many of my booked nights are in which discount periods.
My objective is to do this by using array calculations, so e.g. match Discount Period 1 to Stay Period in a Countif() statement
I have tried Row(Indirect()) to generate the arrays, but cannot figure out the syntax inside the Countif function for it.
I can list out all dates in the file and then use table or range references, but I hope to only use the start/end dates of the travel and discount periods.
Any suggestions?
I leave a screen shot of the file I am working on below

Thanks for any feedback.

1659715334996.png
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Why not just list every date in the year with its respective discount code. Then simple countifs.
 
Upvote 0
Why not just list every date in the year with its respective discount code. Then simple countifs.
Hi
Thanks for your suggestion
There are many hotels with varying discounts periods, as well as other discounts, so I will have to check the travel period up agains all separately.

Brs
Dagf8nn
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

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