Problems with showing the correct number of days in a month?! HELP!!!!

bftznk

New Member
Joined
Apr 17, 2013
Messages
16
Sometimes there are 28/29/30/31 days in a month in a year, right?! What's the simplest ways to meet the following task?

1. The Year or/and month can be change
2. Once the date is change the Week of days in different(Mon, Tue...) would also be changed correctly
3. Show correctly if there are 28/29/30/31,


57935302.jpg

:confused::confused:
Do I need to use VB,Marco or
someting else?! Plz Help!
 
Hello,

My formulas are working quite well.

It shows the wrong days of the week because you're now using a different table from what you originally specified. You really needed to show us the actual table format you are using for us to be of any help. Your dates are showing vertically now instead of horizontally for a start!

A2 = enter year
B2 = enter month number
C2 =DATE(A2,B2,1), format to "d"
D2 =C2, copy down to D32
E2 =C2, format to "ddd", copy down to E32

A3 =IF(ISERROR(YEAR(C3)),"",YEAR(C3)), copy down to A32
B3 =IF(ISERROR(MONTH(C3)),"",MONTH(C3)), copy down to B32
C3 =IF(ISERROR(IF(C2+1 > EOMONTH(C2,0),"",C2+1)),"",IF(C2+1 > EOMONTH(C2,0),"",C2+1)), copy down to C32.

Result:

YearMonthDate Day
20131101/01/2013Tue
20131202/01/2013Wed
20131303/01/2013Thu
20131404/01/2013Fri
20131505/01/2013Sat
20131606/01/2013Sun
20131707/01/2013Mon
20131808/01/2013Tue
20131909/01/2013Wed
201311010/01/2013Thu
201311111/01/2013Fri
201311212/01/2013Sat
201311313/01/2013Sun
201311414/01/2013Mon
201311515/01/2013Tue
201311616/01/2013Wed
201311717/01/2013Thu
201311818/01/2013Fri
201311919/01/2013Sat
201312020/01/2013Sun
201312121/01/2013Mon
201312222/01/2013Tue
201312323/01/2013Wed
201312424/01/2013Thu
201312525/01/2013Fri
201312626/01/2013Sat
201312727/01/2013Sun
201312828/01/2013Mon
201312929/01/2013Tue
201313030/01/2013Wed
201313131/01/2013Thu

<COLGROUP><COL style="WIDTH: 53pt; mso-width-source: userset; mso-width-alt: 2596" span=4 width=71><COL style="WIDTH: 48pt" width=64><TBODY>
</TBODY>

Let me know how it works out.
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
wow, it works vertically, let see if it work horizontally ;) Thx,you are genius, Any books or tranning you can recommend?!
 
Upvote 0

Forum statistics

Threads
1,215,254
Messages
6,123,894
Members
449,132
Latest member
Rosie14

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