Formula based on date

phillipcook

Board Regular
Joined
Jun 25, 2015
Messages
87
Hi everyone

i am trying to figure out a way to do the following formula:
If(and(A1=“site 1”,or(C1=“monthly”,C1=“quarterly,C1=“yearly”)),B1,””)

this formula works, however I Have a date column in D and what I need to achieve is that if C1 has “quarterly”, the date needs to also be within the month of January or July and with “yearly” it has to be within the month of July.

has anyone got any suggestions in relation to the best method with this one?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Assuming your Real Date value in D1, try this:

=IF(AND(A1="site 1",OR(C1="monthly",AND(C1="quarterly",OR(MONTH(D1)={1,7})),AND(C1="yearly",MONTH(D1)=7))),B1,"")
 
Upvote 0
That worked a treat!! I just had to add the iferror at the start to stop all the value error codes. You’re a legend mate!
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,561
Members
449,038
Latest member
Guest1337

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