Ifs, ANDs, ORs, with text strings, grrrrrrrrr.

carabale

Board Regular
Joined
Apr 29, 2004
Messages
133
I have this formula, which works fine.

=IF(OR(AA3="",AB3=""),"N",IF(AND(AL3<>"",AL3>TODAY()+365),"N",IF(AND(AA3<>"",AB3<>""),"Y")))

However, I need it now to indicate "N" if the inmate is a Sex or Career Offender; so I tried this but is not working:

=IF(ISERROR(FIND("SEX",P2)),IF(ISERROR(FIND("CAREER",P2)),"N",IF(OR(AA2="",AB2=""),"N",IF(AND(AL2<>"",AL2>TODAY()+365),"N",IF(AND(AA2<>"",AB2<>""),"Y")))))

I get a "FALSE" when it encounter the string.

I put the formula togethe from bits and pieces of information; so I know is incomplete or out of order. If It could be simplified would be even greater.

As usual, thanks for your help in advance.
 

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

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Is it?

=IF(OR(ISNUMBER(SEARCH("SEX",P3)),ISNUMBER(SEARCH("CAREER",P3)),AA3="",AB3=""),"N",IF(AND(AL3<>"",AL3>TODAY()+365),"N",IF(AND(AA3<>"",AB3<>""),"Y")))
 
Upvote 0

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
Does this work for you?

=IF(OR(SUM(COUNTIF(P2,{"*CAREER*","*SEX*"})),AA2="",AB2="",AND(AL2>TODAY()+365)),"N","Y")
 
Last edited:
Upvote 0

carabale

Board Regular
Joined
Apr 29, 2004
Messages
133
Thank you, thank you, thank you. I was just asked for this report. I thought I had time to figure it out, but I am so glad you all replied so quickly. Saved me from going through 1,300 rows.

I used Mr. Poulsom and it worked marvelous. I have not tried Huish's yet.

But thank you both...
 
Upvote 0

Forum statistics

Threads
1,196,016
Messages
6,012,863
Members
441,737
Latest member
bijayche

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
Top