Shweta
Well-known Member
- Joined
- Jun 5, 2011
- Messages
- 514
Hello All,
I have a data validation list for all the months from January to December. I want to assign quarters to my months based on the selection in the validation list.
For example, If "November (11)" is selected in the validation list, Q1 should be May-July and Q2 should be Aug-Oct. And for rest of the period, I want month itself.
[TABLE="width: 128"]
<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Month[/TD]
[TD="class: xl65, width: 64"]Quarter[/TD]
[/TR]
[TR]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]q1[/TD]
[/TR]
[TR]
[TD="class: xl66"]2[/TD]
[TD="class: xl66"]q2[/TD]
[/TR]
[TR]
[TD="class: xl66"]3[/TD]
[TD="class: xl66"]q2[/TD]
[/TR]
[TR]
[TD="class: xl66"]4[/TD]
[TD="class: xl66"]q2[/TD]
[/TR]
[TR]
[TD="class: xl66"]5[/TD]
[TD="class: xl66"]may[/TD]
[/TR]
[TR]
[TD="class: xl66"]6[/TD]
[TD="class: xl66"]jun[/TD]
[/TR]
[TR]
[TD="class: xl66"]7[/TD]
[TD="class: xl66"]jul[/TD]
[/TR]
[TR]
[TD="class: xl66"]8[/TD]
[TD="class: xl66"]aug[/TD]
[/TR]
[TR]
[TD="class: xl66"]9[/TD]
[TD="class: xl66"]sep[/TD]
[/TR]
[TR]
[TD="class: xl66"]10[/TD]
[TD="class: xl66"]oct[/TD]
[/TR]
[TR]
[TD="class: xl66"]11[/TD]
[TD="class: xl66"]q1[/TD]
[/TR]
[TR]
[TD="class: xl66"]12[/TD]
[TD="class: xl66"]q1[/TD]
[/TR]
</tbody>[/TABLE]
Above is the table for what exactly I want.
Please help with an appropriate formula or vba code.
Thanks in advance!
Regards,
Shweta Jain
I have a data validation list for all the months from January to December. I want to assign quarters to my months based on the selection in the validation list.
For example, If "November (11)" is selected in the validation list, Q1 should be May-July and Q2 should be Aug-Oct. And for rest of the period, I want month itself.
[TABLE="width: 128"]
<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Month[/TD]
[TD="class: xl65, width: 64"]Quarter[/TD]
[/TR]
[TR]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]q1[/TD]
[/TR]
[TR]
[TD="class: xl66"]2[/TD]
[TD="class: xl66"]q2[/TD]
[/TR]
[TR]
[TD="class: xl66"]3[/TD]
[TD="class: xl66"]q2[/TD]
[/TR]
[TR]
[TD="class: xl66"]4[/TD]
[TD="class: xl66"]q2[/TD]
[/TR]
[TR]
[TD="class: xl66"]5[/TD]
[TD="class: xl66"]may[/TD]
[/TR]
[TR]
[TD="class: xl66"]6[/TD]
[TD="class: xl66"]jun[/TD]
[/TR]
[TR]
[TD="class: xl66"]7[/TD]
[TD="class: xl66"]jul[/TD]
[/TR]
[TR]
[TD="class: xl66"]8[/TD]
[TD="class: xl66"]aug[/TD]
[/TR]
[TR]
[TD="class: xl66"]9[/TD]
[TD="class: xl66"]sep[/TD]
[/TR]
[TR]
[TD="class: xl66"]10[/TD]
[TD="class: xl66"]oct[/TD]
[/TR]
[TR]
[TD="class: xl66"]11[/TD]
[TD="class: xl66"]q1[/TD]
[/TR]
[TR]
[TD="class: xl66"]12[/TD]
[TD="class: xl66"]q1[/TD]
[/TR]
</tbody>[/TABLE]
Above is the table for what exactly I want.
Please help with an appropriate formula or vba code.
Thanks in advance!
Regards,
Shweta Jain