IF AND OR Together

Robby19

Board Regular
Joined
Mar 19, 2018
Messages
227
I am trying to have a cell state Compliant or Non-Compliant based off other cells.

If TA Error = FALSE and Days to EAS - TRS Completion is greater than or equal to (>=) 180 show Compliant OR if Days to EAS is >= 180 show Compliant.

This is what I have so far, but it doesn't seem to work.
=IF(AND(OR([@[Days To EAS]=]=>=180),[@[TA Error]]=FALSE,[@[Days to EAS - TRS Completion]=]=>=180),"Compliant","Non-Compliant")

The TRS Compliance, where this formula is located, is sometimes displaying Non-Compliant when it should say Compliant, and vice versa.

TA
TA COMP DATE
DAYS TO EAS
DAYS TO EAS - TRS COMPLETION
TA ERROR
TRS COMPLIANCE
TA
18-APR-18
59
59
FALSE
#N/A
73
43281
TRUE
#N/A
237
43445
TRUE

<tbody>
</tbody>
 
Last edited:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi

How about =IF(OR(AND([@[TA ERROR]]=FALSE,[@[DAYS TO EAS - TRS COMPLETION]]>=180),[@[DAYS TO EAS]]>=180),"Compliant","Non-Compliant")

HTH
DK
 
Upvote 0
So I ran into another problem. The TA COMP Date is an Index Match formula. When I had tested this out originally, I had just "hand jammed" the date into that cell. However, now that it is pulling the date via Index Match from another tab in the spreadsheet, the formula doesn't work.

For example, if the Index Match under the TA COMP DATE is true and pulls the date, the TRS Compliance works. But if the INDEX Match does not pull a date, and instead shows an error, the TRS Compliance is blank.
 
Upvote 0
Hi

Not sure I understand the problem - the formula should return "Compliant" or "Non-Compliant" - have you modified it from what I provided previously?

DK
 
Upvote 0
So I ran into another problem. The TA COMP Date is an Index Match formula. When I had tested this out originally, I had just "hand jammed" the date into that cell. However, now that it is pulling the date via Index Match from another tab in the spreadsheet, the formula doesn't work.

For example, if the Index Match under the TA COMP DATE is true and pulls the date, the TRS Compliance works. But if the INDEX Match does not pull a date, and instead shows an error, the TRS Compliance is blank.

Hi Robby19,

We need more information.

What you have in each column of the table? Value or formula? If formula, what formula?

Markmzz
 
Upvote 0
TA
TA COMP DATE
DAYS TO EAS
DAYS TO EAS - TRS COMPLETION
TA ERROR
TRS COMPLIANCE
TA
18-APR-18
59
59
FALSE
#N/A
73
43281
TRUE
#N/A
237
43445
TRUE

<tbody>
</tbody>

TA - =INDEX(TRS_TA[TRAIN EVENT CODE],MATCH([@EDIPI],TRS_TA[EDIPI],0))

TA COMP DATE - =INDEX(TRS_TA[TRAIN EVENT DATE],MATCH([@EDIPI],TRS_TA[EDIPI],0))

DAYS TO EAS - =[@EAS]-Today

DAYS TO EAS - TRS COMPLETION - =[@EAS]-[@[TA COMP DATE]]

TA ERROR - =ISERROR([@TA])

TRS COMPLIANCE - =IF(OR(AND([@[TA Error]]=FALSE,[@[Days to EAS - TRS Completion]=]=>=181),[@[Days To EAS]=]=>=181),"Compliant","Non-Compliant")

**Disregard the TRS COMPLIANCE formula with the extra "=" signs. Those are not in the formula, but for some reason whenever I copy/pasted into this it was added. It won't let me edit and remove them.**
 
Last edited:
Upvote 0
Hi

Not sure I understand the problem - the formula should return "Compliant" or "Non-Compliant" - have you modified it from what I provided previously?

DK

The only change I made to it was changing 180 to 181, which shouldn't break anything. However, if excel finds an error from the date cell in DAYS TO EAS - TRS COMPLETION then the TRS COMPLIANCE column will show an error as well for the corresponding cell.
 
Upvote 0
TA - =INDEX(TRS_TA[TRAIN EVENT CODE],MATCH([@EDIPI],TRS_TA[EDIPI],0))
TA COMP DATE - =INDEX(TRS_TA[TRAIN EVENT DATE],MATCH([@EDIPI],TRS_TA[EDIPI],0))
DAYS TO EAS - =[@EAS]-Today
DAYS TO EAS - TRS COMPLETION - =[@EAS]-[@[TA COMP DATE]]
TA ERROR - =ISERROR([@TA])
TRS COMPLIANCE - =IF(OR(AND([@[TA Error]]=FALSE,[@[Days to EAS - TRS Completion]=]=>=181),[@[Days To EAS]=]=>=181),"Compliant","Non-Compliant")
**Disregard the TRS COMPLIANCE formula with the extra "=" signs. Those are not in the formula, but for some reason whenever I copy/pasted into this it was added. It won't let me edit and remove them.**

Hi!

Try this in F2

Code:
[COLOR=#0000ff]=IF(IFERROR([@[DAYS TO EAS - TRS COMPLETION]=]=>=181,[@[DAYS TO EAS]=]=>=181),"","Non-")&"Compliant"[/COLOR]


ABCDEFGHIJKLM
1TATA COMP DATEDAYS TO EASDAYS TO EAS - TRS COMPLETIONTA ERRORTRS COMPLIANCEEASEDIPITRAIN EVENT CODETRAIN EVENT DATEEDIPI
2TA18/04/20185963FALSONon-Compliant20/06/20181TA18/04/20181
3#N/D#N/D73#N/DVERDADEIRONon-Compliant04/07/20184TR19/04/20182
4#N/D#N/D237#N/DVERDADEIROCompliant15/12/20185TW20/04/20183
5
**************************************************************************************************************************

<tbody>
</tbody>

Markmzz
 
Upvote 0

Forum statistics

Threads
1,215,379
Messages
6,124,610
Members
449,174
Latest member
ExcelfromGermany

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