If this and or this and then

NGB82KS

Board Regular
Joined
Nov 7, 2019
Messages
82
Office Version
  1. 2016
So I'm (terribly) writing a formula to check the Class, then validate it against the date in Column B or Column D depending on the information in Column I. But I need to put it all into 1 formula as the check.
e.g.
IF(AND([CLASS]="ARCH*",[COURSE1]>=TODAY()),"YES","NO") But I need an Or to add the rest of the calculations
AND([CLASS]="SCIE*",[COURSE2]>=TODAY()),"YES","NO")
AND([CLASS]="HIST*",[COURSE1]>=TODAY()),"YES","NO")

So how do i add multiple checks under and or? =If(or(and)(and))?]
Also if this guess figure out, can you help explain how it's nested... like I search the googles for if(or(and) and I got no results and i have had a similar question in the past that i tried applying but that failed

TABLE1
ROW/COLUMNCOURSE1 DATE
(COLUMN B)
COURSE2 DATE
(COLUMN D)
CLASS
(COLUMN I)
FORMULA
(COLUMN S)
11/11/221/11/22ARCH 100
21/11/2211/10/22ARCH 200
31/10/221/11/22SCIE 100
411/11/2211/11/22SCIE 200
51/12/2210/18/21HIST 100
610/18/2111/16/05HIST 200
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about
Excel Formula:
=IF(or(AND([CLASS]="ARCH*",[COURSE1]>=TODAY()),AND([CLASS]="SCIE*",[COURSE2]>=TODAY()),AND([CLASS]="HIST*",[COURSE1]>=TODAY())),"YES","NO")
 
Upvote 0
How about
Excel Formula:
=IF(or(AND([CLASS]="ARCH*",[COURSE1]>=TODAY()),AND([CLASS]="SCIE*",[COURSE2]>=TODAY()),AND([CLASS]="HIST*",[COURSE1]>=TODAY())),"YES","NO")
Fluff, is there anything in excel you dont know brother?
The code doesn't like my Wildcard "ARCH*" in that formula, but if i replace it with an exact "ARCH 100"it works for that one, any suggestions? or just make more ands?
 
Upvote 0
Missed you had wildcards, try it like
Excel Formula:
=IF(or(AND(left([CLASS],4)="ARCH",[COURSE1]>=TODAY()),AND(left([CLASS],4)="SCIE",[COURSE2]>=TODAY()),AND(left([CLASS],4)="HIST",[COURSE1]>=TODAY())),"YES","NO")
 
Upvote 0
Solution
Missed you had wildcards, try it like
Excel Formula:
=IF(or(AND(left([CLASS],4)="ARCH",[COURSE1]>=TODAY()),AND(left([CLASS],4)="SCIE",[COURSE2]>=TODAY()),AND(left([CLASS],4)="HIST",[COURSE1]>=TODAY())),"YES","NO")
Once again you have saved me about 100 hrs of manually doing this! Cheers!
Can you recommend any other websites I should be looking at for code/formulas (yes,yes other than Mr Excel which is always my 1st stop) to better my knowledge on this stuff?
 
Upvote 0
There are any number of good sites out there. I often look at ExcelJet for formulae, but as I said, there are plenty of others.
 
Upvote 0

Forum statistics

Threads
1,214,543
Messages
6,120,123
Members
448,947
Latest member
test111

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