gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
Which formula can do this: Ignore all colummns and focus on columns N, Q, S, T, & W on…
- User
Which formula can do this:
Ignore all colummns and focus on columns N, Q, S, T, & W on the same row
If column M has a value then display 1
If column Q has a value then ignore column M and show 2
If column S has a value then ignore M & Q and show 3
If column T has a value then ignore M, Q & S and show 4
If column W has a value then ignore M, Q, S & T and show 5
- Assistant
You can achieve this by using a nested
IFstatement in Excel. Here is a formula that fulfills the requirements you outlined:excel=IF(NOT(ISBLANK(W1)), 5, IF(NOT(ISBLANK(T1)), 4, IF(NOT(ISBLANK(S1)), 3, IF(NOT(ISBLANK(Q1)), 2, IF(NOT(ISBLANK(M1)), 1, "")))))In this formula:
- The formula first checks if column W has a value. If it does, it returns 5.
- If W is blank, it then checks column T and returns 4 if T has a value.
- If neither W nor T has a value, it checks column S, returning 3 if S has a value.
- If S is also blank, it checks column Q, returning 2 if Q has a value.
- If all these columns are blank, it then checks column M and returns 1 if M has a value.
- If all specified columns (M, Q, S, T, W) are blank, it returns an empty string.
Please remember to adjust the row number (the "1" in M1, Q1, etc.) to the specific row you are working with or to drag the formula down through your data.