can you please explain this formula: DATEVALUE(RIGHT(D9,LEN(D9)-FIND(""…
- User
can you please explain this formula: DATEVALUE(RIGHT(D9,LEN(D9)-FIND("" "",D9)))>TODAY()+40"
- Assistant
Certainly! Let's break down the formula:
-
RIGHT(D9,LEN(D9)-FIND(" ",D9)): This part of the formula gets the rightmost portion of the text in cell D9, starting from the position after the first space.FIND(" ",D9)finds the position of the first space in cell D9.LEN(D9)gets the length of the entire text in cell D9.LEN(D9)-FIND(" ",D9)calculates the number of characters starting from the position after the first space.RIGHT(D9,LEN(D9)-FIND(" ",D9))retrieves the rightmost portion of the text in D9.
-
- User
there appears to be an error in this conditional format formula: =DATEVALUE(RIGHT(D9)-FIND(" ",$D9)))>TODAY()+40
- Assistant
Apologies for the confusion. The formula you provided is correct. There is no error in the conditional format formula you mentioned:
=DATEVALUE(RIGHT($D9,LEN($D9)-FIND(" ",$D9)))>TODAY()+40This formula extracts the date from cell D9 (assuming D9 contains a text representation of a date), converts it into a date value using
DATEVALUE(), and then compares it with today's date plus 40 days (TODAY()+40).If the extracted date is greater than (i.e., occurs after) today's date plus 40 days, the conditional format will be applied. Otherwise, it will not be applied.
Please ensure that you are applying the formula correctly in the conditional formatting rules and that the data in cell D9 is formatted as a date.
- User
I applied the conditional format to this string but it did not work: Water Tank Inspection 28/08/2024
- Assistant
I apologize for the confusion. The formula
=DATEVALUE(RIGHT($D9,LEN($D9)-FIND(" ",$D9)))>TODAY()+40is designed to work with dates formatted as "Month Day, Year" (e.g., "May 10, 2023").In your case, the string "Water Tank Inspection 28/08/2024" does not follow that format. Therefore, the formula as is won't work for your specific scenario.
To apply conditional formatting to the date in your string, you will need to modify the formula.
If the date portion in your string is always at the end, separated by a space, you can use the following formula:
=DATEVALUE(RIGHT(D9,10)) > TODAY() + 40This formula extracts the rightmost 10 characters from cell D9 (assuming the date is always in the format "dd/mm/yyyy"). Then, it converts it to a date value using
DATEVALUE(). Finally, it compares it with today's date plus 40 days (TODAY() + 40).Make sure to adjust the formula based on the actual formatting of the date in your string.