Date formula to find value

Forestq

Active Member
Joined
May 9, 2010
Messages
482
Hi,

I have below table1 (sheet1):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="width: 78"]StartDate(A1)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="width: 78"]EndDate(B1)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Month(C1)[/TD]
[TD]Quater(D1)[/TD]
[TD]Year(E1)[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]29/07/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]25/08/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[TD]Q1[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]26/08/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]22/09/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]2[/TD]
[TD]Q1[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]23/09/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]27/10/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]3[/TD]
[TD]Q1[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]28/10/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]24/11/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]4[/TD]
[TD]Q2[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]25/11/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]22/12/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]5[/TD]
[TD]Q2[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]23/12/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]26/01/2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]6[/TD]
[TD]Q2[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]27/01/2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]23/02/2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]7[/TD]
[TD]Q3[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]24/02/2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 78"]
<tbody>[TR]
[TD="class: xl65, width: 78, align: right"]23/03/2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]8[/TD]
[TD]Q3[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: right"]2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]..[/TD]
[TD]..[/TD]
[TD]..[/TD]
[TD]..[/TD]
[TD]..[/TD]
[/TR]
</tbody>[/TABLE]

Table is filled in this way till 2017.
Now into tab "sheet2" into col A, I have dates:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Dates(A1)[/TD]
[TD]Month (B1)[/TD]
[/TR]
[TR]
[TD]24/08/2012[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]25/09/2012[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]20/12/2012[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]01/11/2013[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]03/10/2012[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]

How to add month value based on table1?

I don't want to do a lot of if....is other way? How to write simple function to fill month based on table1?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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