Complicated If Statement

Lindsay0385

New Member
Joined
Dec 21, 2016
Messages
30
Hello,

This is my first time posting here and I'm hoping someone can help me. When I usually come across an Excel issue I'm not familiar with I search Google and usually find something that works. But I couldn't find anything similar to what I'm trying to accomplish.

I have a two column spreadsheet, with Column A, "Status", and Column B, "Ready". My goal is to have Column B update automatically based on the value of Column A and the current date. Column A, "Status", has data validation with the selection of "In Pipeline", "2016/Q4", "2017/Q1", "2017/Q2", "2017/Q3", "2017/Q4", and "2018/Q1". Column B, "Ready", will need a value of "X" if the status is "In Pipeline", in the current quarter, or in a past quarter.

Right now I'm manually updating the "Ready" column, but that will be cumbersome in the future. I have a formula that will work to update if the status is "In Pipeline" or in the current quarter, but I cannot figure out how to include past quarters in the formula. Below is an example of my spreadsheet and the formula in Column B.

Capture.png


Formula in B2: =IF(OR((A2=(YEAR(TODAY())&"/Q"&INT((MONTH(TODAY())+2)/3))),A2="In Pipeline"),"X","")
(I found a formula for generating the quarter online and formatted it to fit how I need the status displayed)

Right now the formula works fine, but in January the "2017/Q1" status will have the X's in Column B (which is what I want), but the "2016/Q4" X's will disappear (which I don't want). I can manually update the IF statement to include another OR each quarter (ex. add OR(A2="2016/Q4")), but I wanted to see if anyone else has an idea that would work so I don't have to remember to update the formula each quarter.

Thanks for your help. Hopefully someone out there can help!

Lindsay
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi Lindsay,

You could give a try to the following formula :

=IF(A2="In Pipeline","X",IF(OR((A2=(YEAR(TODAY())&"/Q"&INT((MONTH(TODAY())+2)/3))),VALUE(LEFT(A2,4))<YEAR(TODAY())),"X",""))

HTH
 
Upvote 0
Try this:

=IF(OR((TODAY()>=DATE(--LEFT(A2,4),RIGHT(A2)*3-2,1),A2="In Pipeline"),"X","")
 
Upvote 0
Hi James - I tried your formula, but I couldn't get it to work.

Hi Tetra - Your formula works for the quarter statuses, thank you! But for some reason it returns a #VALUE! error for the "In Pipeline" status, which is odd. It looks to be formatted correctly. But I changed it slightly to the following and it works! Thank you, thank you!

=IF(A2="In Pipeline","X",IF(OR((TODAY()>=DATE(--LEFT(A2,4),RIGHT(A2)*3-2,1))),"X",""))

Thank you both! I appreciate your help!
 
Upvote 0
... formula works for the quarter statuses, thank you! But for some reason it returns a #VALUE! error for the "In Pipeline" status...
Oops, I just copied a wrong formula. It should have been this:

=IF(OR(TODAY()>=IFERROR(DATE(--LEFT(A1,4),RIGHT(A1)*3-2,1),10^10),A1="In Pipeline"),"X","")

Glad you've found your own workaround.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,415
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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