I need an excel formula that finds the last cell in column A that starts with any of…
- User
I need an excel formula that finds the last cell in column A that starts with any of these words 'Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday'
- Assistant
To find the last cell in column A that starts with any of the words 'Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday', you can use the following formula in Excel:
=INDEX(A:A,MAX(IF((LEFT(A:A,LEN("Monday"))="Monday")+(LEFT(A:A,LEN("Tuesday"))="Tuesday")+(LEFT(A:A,LEN("Wednesday"))="Wednesday")+(LEFT(A:A,LEN("Thursday"))="Thursday")+(LEFT(A:A,LEN("Friday"))="Friday")+(LEFT(A:A,LEN("Saturday"))="Saturday")+(LEFT(A:A,LEN("Sunday"))="Sunday"),ROW(A:A),0)))
This formula uses the INDEX function along with the MAX function and an array formula. Here's how it works:
- The LEFT function is used to extract the first few characters from each cell in column A.
- The LEN function is used to get the length of the specified words (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday).
- The "+" operator is used to check if any of the extracted words match the specified words. If a match is found, it evaluates to 1, otherwise 0.
- The IF function is used to return the row number if a match is found, otherwise 0.
- The MAX function is used to find the maximum row number where a match was found.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.