If date is in January, copy cell

Yulyo

Board Regular
Joined
Jul 17, 2017
Messages
94
Hello all,
I need some help creating a formula as follows:

On sheet2!B2 I have some dates formatted as
01.01.2018
02.01.2018
03.01.2018.....

On cell g2 I must create a formula to do something like this :
If the date on B2 is in January, copy sheet1!CU6, if B3 is January, copy sheet! CU6......... IF B35 is in February, copy sheet!CV6

I have to do this for around 200 tables and I was thinking that maybe a formula exists, so I can simplify my work...

On sheet 1 I have a table with some values / month.

So, the formula must look if the dates belong to what month and then depending on the month copy a value from a cell in sheet1.

I have no ideea how to do something like this, or if it's even possible to do it...

I hope I was clear enough.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi there, I am assuming that your dates are formatted as actual dates, such that 01.01.2018 is the same as "1/1/2018". If that is the case, try this:

=IF(AND(B2>=DATEVALUE("1/1/2018"), B2<<datevalue("2 1="" 2018")),="" 'sheet1!cu6',="" if(and(b2="">DATEVALUE("2/1/2018")), 'Sheet1'!CU6, IF(AND(B2>=DATEVALUE("2/1/2018"), B2<DATEVALUE("3/1/2018")), 'Sheet1'!CV6, IF(AND<datevalue("3 1="" 2018")),="" 'sheet1'!cv6,="" if(and(<datevalue("3="" if(and(b2="">... <datevalue("3 1="" 2018")),="" 'sheet1'!cv6,="" if(and(<datevalue("3="" 'sheet1!cv6',="" if(and(<strong="">etc.

Unfortunately, I believe this is the only way to do it through Excel formulas. One way to make this easier would be to just create a 2 column list that has the 1st and last day of each month on it to just use cell references in the formula rather than typing out the dates each time, and then simply changing the comparison signs in my formula above. For example:

A B
1/1/2018 1/31/2018
2/1/2018 2/28/2018
3/1/2018 3/31/2018</datevalue("3></datevalue("3></datevalue("2>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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