Help with IF AND EXCEL Formula

pattih

New Member
Joined
Feb 26, 2013
Messages
44
My formula IF(AND((K4,"Non-Discretionary,M2<44926,"Priority 1",IF(AND((K4,"Discretionary,L4,Discretionary","Priority 3","Not Prioritized")

is returning #VALUE

What I want the formula to do: if k4 = non-discretionary and M2 is less than 12/31/2022, put Priority 1, if K4=discretionary and L4 = discretionary, put Priority 3, and if none of those are true, put "Not Prioritized

for the date column (M), it is formatted as a date, so I wasn't sure i i put in the actual date or the value in the formula.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
G'day Pattih,
You have a number of issues to do with the parentheses, quotation marks and seperators (commas)

For example, K4,"Non-Discretionary,M2
should be K4="Non-Discretionary",M2

You also open 6 parentheses, and only close 1 - you actually only need to open 2 and close 2 for your formula to work correctly

I have tested the following and it works
=IF(AND(K4="Non-Discretionary",M2<44926),"Priority 1",IF(AND(K4="Discretionary",L4="Discretionary"),"Priority 3","Not Prioritized"))
 
Upvote 0
Clearly I am not good at either counting or seeing parentheses - open and close four sets of parentheses.
 
Upvote 0
G'day Pattih,
You have a number of issues to do with the parentheses, quotation marks and seperators (commas)

For example, K4,"Non-Discretionary,M2
should be K4="Non-Discretionary",M2

You also open 6 parentheses, and only close 1 - you actually only need to open 2 and close 2 for your formula to work correctly

I have tested the following and it works
=IF(AND(K4="Non-Discretionary",M2<44926),"Priority 1",IF(AND(K4="Discretionary",L4="Discretionary"),"Priority 3","Not Prioritized"))


Thank you so much for you help! I have copied the formula to my spreadsheet and it worked like a charm! Perfect!
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top