Forum Discussion
rw2020
Jun 30, 2022Copper Contributor
IF/AND/OR Formula
Hello! I am hoping someone can help me write a complicated formula.
I have the following columns:
F: Payment Date
😧 Grant Committed Date
O: Payment Type
J: Payment Amount
I am trying to write a formula that will look at these columns and do the following:
IF
Payment Date is in 2021
Grant Committed Date is prior to 2021
Payment Type is "Conditional" or "Conditions Satisfied"
THEN
Display Payment Amount
IF
Conditions above are not met, leave cell blank
This is what I have right now but I'm doing something wrong:
=IF(AND(F2>=DATEVALUE("1/1/2021"),F2<=DATEVALUE("12/31/2021"),(OR,O2,"Conditional","Conditions Satsified"),AND(D2<datevalue("1/1/2021"))),J2,"")
=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.
5 Replies
Sort By
- OliverScheurichGold Contributor
=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.
- Rebekah110Copper 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.
- OliverScheurichGold Contributor
You are welcome. Glad i was able to help.