Forum Discussion
IF/AND/OR Formula
- Jun 30, 2022
=IF(AND(YEAR(F2)=2021,YEAR(D2)<2021,OR(O2="Conditional",O2="Conditions Satisfied")),J2,"")You can try this formula which seems to work in my sheet.
=IF(AND(YEAR(F2)=2021,YEAR(D2)<2021,OR(O2="Conditional",O2="Conditions Satisfied")),J2,"")You can try this formula which seems to work in my sheet.
- Rebekah110Jul 07, 2022Copper Contributor
OliverScheurich thank you SO much for your reply! This formula worked perfectly and you taught me about the YEAR function which is much neater than what I had been using. I improved my entire spreadsheet thanks to this. This may have seemed obvious to you but it seems like magic to me and I really appreciate you taking the time to respond and help me.
- OliverScheurichJul 07, 2022Gold Contributor
You are welcome. Glad i was able to help.
- Rebekah110Jul 11, 2022Copper Contributor
OliverScheurich hello! I'm still toiling away on this spreadsheet, trying to get all my formulas set up for future years. The column I'm working on now has the following conditions:
Column 😧 Grant Committed Date
Column F: Grant Payment Date
Column J: Payment Amount
Column O: Payment Type
IF
Grant Committed Date prior to 2021
Payment type NOT "conditional"
Payment type NOT "conditions satisfied" IF payment date is after 2020 OR payment date is blank
THEN
Insert Payment Amount
IF NOT
Insert blank
This is what I have now:
=IF(AND(YEAR(D6)<2021,O6<>"Conditional",(OR(O6="Conditions Satisfied",AND(OR(YEAR(F6)>2020,F6=""))))),J6,"")
It is excluding the conditional payments correctly but not the ones marked conditions satisfied that were paid after 2020.
Again, I'm sure this is something obvious I'm doing wrong, but I would appreciate your guidance! Thank you!