IF and AND Formulas

Pattatatat

New Member
Joined
Feb 13, 2013
Messages
10
I already have used a formula to notify me that a job is $20K or more by using =IF(T20>20000,"X", " ") and obviously in T20 is the project amount. I use this becuase I have to track the time for a job $20K or larger

Now, in F20, the cell directly to the left of this formula is the state which the job is in. I no longer have to track jobs in NH or MA, but any other state abbreviation that is also $20K or more will have to be tracked. Is there something to add, so my X onyl appears when the job is $20K or more AND in any state other than NH or MA?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
=IF(AND(T20>20000, F20<>"NH", F20<>"MA"),"X", " ") should work. If you have a job that is exactly $20k this will give a blank, so if that's a concern then you should change the T20>20000 to T20>=20000.
The <> means "not equals" in Excel, so the added bit just makes sure that you don't have either of those two things entered in F20.
 
Upvote 0
Welcome to MrExcel.

Try:

Code:
=IF(AND(S20<>{"NH","MA"},T20>=20000),"X","")

Matty
 
Last edited:
Upvote 0
Man, I was so happy I got such a quick response, but unfortunately my X still shows up in NH and MA jobs over 20K - thanks for the suggestion, I think I may be getting closer
 
Upvote 0
My formula works fine for me - perhaps you have extra spaces in your state column, or some other oddity? If spaces are the issue then you can use a TRIM(F20).

If you're trying Matty's formula, he fixed the OR/AND confusion but he's using S20 instead of F20 which would give you problems.
 
Upvote 0
Ill keep trying to mess with it. Ill let you know how it works out. I did already fix the cell though =)
 
Upvote 0
but he's using S20 instead of F20 which would give you problems.

Good spot. Tonight's wine's clearly gone to my head a little quicker than I thought. :oops:

Matty
 
Upvote 0
Thank you. In looking at this again, I realized I probably looked over this quickly and did not realize your formula was slightly different - it worked. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,221,417
Messages
6,159,789
Members
451,589
Latest member
Harold14

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