Formula not working

coleyoder

New Member
Joined
Nov 29, 2018
Messages
9
I put this formula in my spreadsheet to help put "pass" or "passes" according to the number on the cell I chose to use.

here is the formula:

=IF(M2="1","Pass",IF(M2="2","Passes",IF(M2="3","Passes",IF(M2="4","Passes",IF(M2="5","Passes",IF(M2="6","Passes",IF(M2="7","Passes",IF(M2="8","Passes",IF(M2="9","Passes",IF(M2="10","Passes",IF(M2="11","Passes",IF(M2="12","Passes",IF(M2="13","Passes",IF(M2="14","Passes",IF(M2="15","Passes",IF(M2="16","Passes",IF(M2="17","Passes","")))))))))))))))))


If anyone sees anything wrong or can help me understand why it isn't working that would be greatly appreciated.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
If M2 is a number then you need to remove the quotes around "1", "2" etc.
Another way of doing it would be
=IF(M2=1,"Pass",IF(AND(M2>1,M2<=17),"Passes",""))
 
Upvote 0
how about

=if(M2=1,"Pass",if(M2<=17,"Passes",""))
 
Upvote 0
If M2 is a number then you need to remove the quotes around "1", "2" etc.
Another way of doing it would be
=IF(M2=1,"Pass",IF(AND(M2>1,M2<=17),"Passes",""))


Figured it out everyone!

Thanks for the advice it was super helpful
 
Upvote 0
Glad it's sorted & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

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