SUMMARY
I have a cell (K16) that references to another sheet for when someone has been promoted, and another cell (M16) that works out if the person is still on their 1 day cooldown by checking it against the date they were promoted. (K16). I want to be able to make it so when I start to promote someone, it highlights if they are still on cooldown, however, I cannot work out how to do this because cell K16 is equal to =IFS(ISBLANK(E16),"",MAX(INDEX((E16='Promo/Demo Log'!D$5:D)*'Promo/Demo Log'!C$5:C))=0,(MAX(INDEX((G16='Tryout Log'!D$5:D)*'Tryout Log'!B$5:B))),ISNUMBER(E16),MAX(INDEX((E16='Promo/Demo Log'!D$5:D)*'Promo/Demo Log'!C$5:C)))
For reference E16 is a person's ID so it searches for their ID which is what's used to fill in a person's promotion.
This is causing me issues as K16 instantly updates to the new date as soon as I fill it in on the promotion log, which means that the check I currently have on the Promo/Demo Log which is meant to see if the person is on cooldown still is useless as when it checks, K16 has already been updated to the new date so it is constantly telling me the person is on cooldown.
The code I have that checks this is:
=IFERROR(IF(VLOOKUP(D14,{Roster!$E:$E,Roster!$D:$D},2,FALSE) =H14,INDEX(Roster!M:M,MATCH(TRUE,ISNUMBER(SEARCH(D14,Roster!E:E)),0) ),0))
D14 is the person's ID on the 'Promo/Demo Log' so it searches the roster for that same ID. Column E on the 'Roster' sheet is where the person's ID would be on the roster and column D on the 'Roster' sheet is their rank which checks against H14 on 'Promo/Demo Log' and if the rank is equal then it displays the date. This works but isn't fully needed, I only added the check rank bit to try to fix the issue I was having.
FULL DETAIL
So, I am currently making this for an online game I'm playing, and for some context the roster is used for a regiment within the game to list the members in that regiment. The different sheets on it are as follows:
Roster: - Main sheet that displays everyone currently in the regiment Tryout Log: - The page where people will fill in who they did a tryout for as well as their own information. Member Data: - When someone joins the regiment, their information is put on this sheet and they are assigned a unique number. Promo/Demo Log: - The log where peoples promotions and demotions are filled out and by who.
On the 'Roster' sheet the main bit of code that is referenced is in Column K, titled 'Last Promotion' and column M, titled 'Cooldown Expired'.
I will attempt to describe my issue as best as I can.
Whenever anyone joins the regiment, this is started by a tryout, the first thing after a tryout is to fill in the 'Tryout Log' sheet with the person's tryout information (their name, SteamID, Discord and Region). The person who hosted the tryout also has to fill in their information and date when the tryout took place. Once the information is filled in, they then go to the 'Member Data' sheet and fill in the new person's information (whoever just passed the tryout) to assign them a unique ID (a number). The reason for this is some code on the roster like the persons name, steamID and discord use the unique ID to lookup the information.
After someone has been given that Unique ID on the Member Data sheet, on the 'Roster' sheet you then fill in the ID box with the person's assigned unique number, that then auto generates the rest of their information. One of those cells is the 'Last Promotion' cell (in Column K) which searches for the person's ID in the 'Promo/Demo Log', if it can't find it in there (because the person is a Private and just joined the regiment through a tryout so hasn't been promoted yet) it then searches the 'Tryout Log' sheet and returns the very last date that matches up to that person's ID, so you can see when they most recently joined the regiment or were promoted.
The next column over from that is the 'Cooldown Expired' column (Column M). This just calculates if they are off cooldown using: =IF(AND(K16<=TODAY()-1,A16=1), TRUE, FALSE) --K16 is the cell in which the date the person was last promoted is in.
Now, my main issue relies on the 'Promo/Demo Log' page. I am attempting to make it so as someone fills out a promotion, when they put in the Date first and then the person who has been promoted's unique ID, if that person is STILL on cooldown it'll be highlighted so that people aren't accidentally promoted while still on cooldown. However, due to the nature of the people in the regiment moving up and down in ranks and their date of last promotion changing all the time, I have found this very difficult to do.
When I first thought I'd managed to do it, I found that when you enter in the date on the 'Promo/Demo Log' to log the persons promotion, as soon as you put the unique ID next to it, because column K on the 'Roster' sheet is actively looking for the persons ID and a date of promotion, the roster automatically updates itself to say that the person was promoted to whatever the date that was just filled in was. E.g if someone was last promoted on the 7th Feb 2022 and they have a 1 day cooldown, if on the 9th Feb 2022 the person was then promoted and whoever was filling in the promotion started filling in the log, as soon as they put in 09/02/2022 and the person's ID, the roster will instantly change to 09/02/2022 from 07/02/2022. This usually would be good but because I wanted a check to be carried out on the 'Promo/Demo Log' to check if the person really was off cooldown, this breaks that as they instantly are not off cooldown because the date has just changed to the day they were promoted, which ruins the whole point of the check as it will always say the person being promoted is still on cooldown.
All code I've used and attempted to solve this problem with are on the sheet, I've tried to annotate it as best as I could to help anyone understand the issue I'm having.
I apologise for such a long description, especially as I know it's going to be very confusing. I've spent days trying to solve this, so hopefully this will be challenging for someone else and you won't take 5 minutes to solve it...
Any help is appreciated, thanks :) If anyone here does use Discord and would like to get in contact with me via that, my Discord is louis#8564
Below is a link to the Google Sheet: https://docs.google.com/spreadsheets/d/1q0dL1eQE9HL0kQTTTjPcicooqtvCBc-5mWb1PWtYz2s/edit?usp=sharing