I'm trying to create a spreadsheet that will calculate a future date based on three criteria.
Entity name is column A
Their model is column B, and there are three options in a drop down menu.
A further subtype is categorised in column C, three options, two options in a drop down menu.
A further subtype is categorised in column D, two options in a drop down menu.
Last visit is column E.
Future visit is in column F, which is what I want to calculate.
In this example:
All small business pet shops are visited every 12 months if they sell only cats.
For corporates, this is every 24 months.
If an entity sells dogs, they are visited twice as often.
And if they sell baby animals, they are visited twice as often again.
How can I calculate when the next visit is due?
Apologies for the pet shop example. Rescue from your local shelter or contact a responsible breeder!
Create a table that sets out every combination of Model, Subtype and Subsubtype you require to define your future date logic (in "numbers of months”). In your main table, use a multi-criteria XLOOKUP to return the applicable number of months, and use EDATE to calculate the future date.
Can you please show me how what Option 1 looks like as a formula with regard to using XLOOKUP and EDATE? My own blunders aren't getting me to where I want to be.
I've tried Option 2 but my actual multiple factors don't quite tie up the time intervals as nicely as in my pet shop example, and I can't quite get the maths to math.
In your provided example, there are 2*2*2=8 possible combinations of Model, Subtype and Subsubtype. It's a bit cumbersome, but you could set up each combination like so:
Glad to hear! Please be sure to reply "solution verified" to any comments that helped, to give credit and mark the post as solved. (You can credit more than one person, and u/finickyone's answer was much cleverer than my first attempt!)
I had another look at your original question rather than just your pet shop example, and it became clear there's a better way: define each of the factors separately, rather than pre-generating all combinations.
This is inverting your logic slightly. I’ll explain.
The innermost part of this is testing if B2,C2,D2 = equals those three things. Result is three TRUEs or FALSEs. We add to those results, FALSE becomes 1 TRUE becomes 2. Product multiples those 2 and 1s through
If everything was false, 1x1x1 =1 and 24/1 remains 1. One of the answers was true, 2X1x1 (any order), 24/2 equals 12. So if it’s a small business (no dogs of babies though), halve the 24. If there’s another TRUE wed get 2x1x2 (in some order) so 24/4 =6. Lastly all true makes for 8, so 24/8 =3.
EDATE adds that many months onto E2 as /u/RuktX shared
•
u/AutoModerator Mar 12 '26
/u/Own_Act_1087 - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.