#1   Report Post  
Ajit Munj
 
Posts: n/a
Default Days in Calender

I have entered 01.02.2005 in A1 and format the cell as "mmmm, yyyy"
to show as "February, 2005". Now I want excel to calculate
the no. of days in Feb, 2005 and show the days as Mon, Tue,
Wed...etc from cell b2 to ab2 and date as 1,2, 3 ... from c3
to ac3. If I put 01.03.2005 in A1 to show March, 2005, excel
should calculate 31 days and show the days as Mon, Tue etc.
from b2 to ae2..
Thansk
Ajit

--
Knowldege is Power
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

one way (your ranges are a bit confusing, but you should be able to
adapt):

B2: =IF(B3<"",B3,"")
B3: =IF(MONTH($A1+COLUMN()-2)=MONTH($A1),$A1+COLUMN()-2,"")

Format B2 as

Format/Cells/Number/Custom ddd

Format B3 as

Format/Cells/Number/Custom d

Copy B2:B3 across to AE2:AE3

Format B1 as mmmm,In article
,
Ajit Munj wrote:

I have entered 01.02.2005 in A1 and format the cell as "mmmm, yyyy"
to show as "February, 2005". Now I want excel to calculate
the no. of days in Feb, 2005 and show the days as Mon, Tue,
Wed...etc from cell b2 to ab2 and date as 1,2, 3 ... from c3
to ac3. If I put 01.03.2005 in A1 to show March, 2005, excel
should calculate 31 days and show the days as Mon, Tue etc.
from b2 to ae2..
Thansk

  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

B2=IF(MONTH($A$1+COLUMN()-2)=MONTH($A$2),$A$1+COLUMN()-2
,"")
and format as Custom "ddd";
C2=IF(MONTH($A$1+COLUMN()-2)=MONTH($A$2),$A$1+COLUMN()-2
,"")
and format as Custom "d";

Select B2:C2, and drag to right for 31 columns (31, when you may use some
other month in cell A1)

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Ajit Munj" wrote in message
...
I have entered 01.02.2005 in A1 and format the cell as "mmmm, yyyy"
to show as "February, 2005". Now I want excel to calculate
the no. of days in Feb, 2005 and show the days as Mon, Tue,
Wed...etc from cell b2 to ab2 and date as 1,2, 3 ... from c3
to ac3. If I put 01.03.2005 in A1 to show March, 2005, excel
should calculate 31 days and show the days as Mon, Tue etc.
from b2 to ae2..
Thansk
Ajit

--
Knowldege is Power



  #4   Report Post  
Ajit Munj
 
Posts: n/a
Default

Thanks JE, its amazing! But will you pl. explain me the why column()-2 is used?
How does it work? I am not able to work out?
Ajit

"JE McGimpsey" wrote:

one way (your ranges are a bit confusing, but you should be able to
adapt):

B2: =IF(B3<"",B3,"")
B3: =IF(MONTH($A1+COLUMN()-2)=MONTH($A1),$A1+COLUMN()-2,"")

Format B2 as

Format/Cells/Number/Custom ddd

Format B3 as

Format/Cells/Number/Custom d

Copy B2:B3 across to AE2:AE3

Format B1 as mmmm,In article
,
Ajit Munj wrote:

I have entered 01.02.2005 in A1 and format the cell as "mmmm, yyyy"
to show as "February, 2005". Now I want excel to calculate
the no. of days in Feb, 2005 and show the days as Mon, Tue,
Wed...etc from cell b2 to ab2 and date as 1,2, 3 ... from c3
to ac3. If I put 01.03.2005 in A1 to show March, 2005, excel
should calculate 31 days and show the days as Mon, Tue etc.
from b2 to ae2..
Thansk


  #5   Report Post  
Ajit Munj
 
Posts: n/a
Default

Thanks Arvi, its amazing! But will you pl. explain me the why column()-2 is
used?
How does it work? I am not able to work out?
Ajit

"Arvi Laanemets" wrote:

Hi

B2=IF(MONTH($A$1+COLUMN()-2)=MONTH($A$2),$A$1+COLUMN()-2
,"")
and format as Custom "ddd";
C2=IF(MONTH($A$1+COLUMN()-2)=MONTH($A$2),$A$1+COLUMN()-2
,"")
and format as Custom "d";

Select B2:C2, and drag to right for 31 columns (31, when you may use some
other month in cell A1)

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Ajit Munj" wrote in message
...
I have entered 01.02.2005 in A1 and format the cell as "mmmm, yyyy"
to show as "February, 2005". Now I want excel to calculate
the no. of days in Feb, 2005 and show the days as Mon, Tue,
Wed...etc from cell b2 to ab2 and date as 1,2, 3 ... from c3
to ac3. If I put 01.03.2005 in A1 to show March, 2005, excel
should calculate 31 days and show the days as Mon, Tue etc.
from b2 to ae2..
Thansk
Ajit

--
Knowldege is Power






  #6   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

Let's analyze the formula for B2 for case a value is returned, i.e. the
formula processed will be
=$A$1+COLUMN()-2
The COLUMN() function returns the current column number - for cell B2 it
returns 2
2-2=0
So in cell B2 the formula returns
=$A$1+0
i.e. the same date, as entered into A1, is returned
The conditional part of IF in formula compares months of 2 identical data -
of-course they always are same (sorry, but I just discovered an error in my
formula - there must be MONTH($A$1))

Now let's make a similar analyse for C2
When the contition test is passed, for this cell COLUMN() returns 3, 3-2=1.
When 1 is added to some date, it means a day is added - so we get next date
(02.02.2005 for your example).
Again a conditional check is made - as both dates 01.02.2005 and 02.02.2005
are from same month, the check passes, and the date is returned.

So goes it on - in each column the number added to staring day is increased
by 1. In cell AC2 the date 28.02.2005 is returned. In next (in cell AD2)
column, the returned date will be 01.03.2005 - so the conditional check
returns false, and an empty srting is returned instead of date. The same for
rest of cells in same row (AE2:AF2).

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Ajit Munj" wrote in message
...
Thanks Arvi, its amazing! But will you pl. explain me the why column()-2

is
used?
How does it work? I am not able to work out?
Ajit

"Arvi Laanemets" wrote:

Hi

B2=IF(MONTH($A$1+COLUMN()-2)=MONTH($A$2),$A$1+COLUMN()-2
,"")
and format as Custom "ddd";
C2=IF(MONTH($A$1+COLUMN()-2)=MONTH($A$2),$A$1+COLUMN()-2
,"")
and format as Custom "d";

Select B2:C2, and drag to right for 31 columns (31, when you may use

some
other month in cell A1)

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Ajit Munj" wrote in message
...
I have entered 01.02.2005 in A1 and format the cell as "mmmm, yyyy"
to show as "February, 2005". Now I want excel to calculate
the no. of days in Feb, 2005 and show the days as Mon, Tue,
Wed...etc from cell b2 to ab2 and date as 1,2, 3 ... from c3
to ac3. If I put 01.03.2005 in A1 to show March, 2005, excel
should calculate 31 days and show the days as Mon, Tue etc.
from b2 to ae2..
Thansk
Ajit

--
Knowldege is Power






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula to calculate # of days between dates, excluding holidays abs2299 Excel Discussion (Misc queries) 8 March 3rd 05 02:21 AM
HOW TO CALCULATE THE DAYS? Bel Excel Worksheet Functions 2 February 2nd 05 07:05 PM
Subracting Dates to come up with the # of days between them KimberlyC Excel Worksheet Functions 8 December 20th 04 09:46 PM
Calculating Production/Man Days in Excel mpetersen Excel Discussion (Misc queries) 3 December 16th 04 02:41 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"