I am trying to write an If statement for multiple conditions that is a bit tricky. I am trying to write a condition in column E that says Yes or No. I want to include this in a pivot table report. The condition is when the type is equal to credit and the date is equal to or greater than 2/1/22 then I want a yes in column E, but to also include the original type= sale that could have occurred before 2/1/22.
So in this case for example for invoice 100, there is a credit that occurred at 2/5/22, but there is a SALE that occurred on 12/13/21 so both would be yes. Here is what I am looking for.
So in this case for example for invoice 100, there is a credit that occurred at 2/5/22, but there is a SALE that occurred on 12/13/21 so both would be yes. Here is what I am looking for.
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | What I want | ||||||
2 | Date | Type | Invoice # | Amount | Include | ||
3 | 12/13/2021 | Sale | 100 | 15 | Yes | ||
4 | 1/15/2022 | Credit | 200 | 30 | No | ||
5 | 2/5/2022 | Credit | 100 | 10 | Yes | ||
6 | 1/1/2022 | Sale | 200 | 50 | No | ||
7 | 2/10/2022 | Sale | 300 | 60 | Yes | ||
8 | 2/16/2022 | Credit | 300 | 20 | Yes | ||
Sheet2 |