#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Leap Year

Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Leap Year

1)
=IF(O8="February",IF(MOD(S8,400)=0,29,IF(MOD(S8,10 0)=0,0,IF(MOD(S8,4)
=0,29,0))),29)

2)
=IF(OR(O8={"February","September","April","June"," November"},0,31)

HTH
Kostis Vezerides

On Apr 29, 5:34*pm, BadBoy wrote:
Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)

2) - In the formula below, if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Leap Year

Point1:
In which cell are you using your formula. In S8 ?
Or Is the year entered in S8.

Point 2:
Please find the below formula to return 0 or 31.
=IF(O8={"February","September","April","June","Nov ember"},0,31)

If you are looking at returning the days of a month from the "month text"
let me know..


If this post helps click Yes
---------------
Jacob Skaria


"BadBoy" wrote:

Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Leap Year

"BadBoy" wrote:
If February is in cell O8 and its a leap year, put the number 29 in cell
S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.


=if(or(O8<"February",day(date(S8,3,0))=29),29,0)


if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8


=If (or(O8={"February","September","April","June","Nov ember"}),0,31)

Note: I assume you mean to put this formula in some other cell, not O8
[sic].


FYI, both formulas can be written without IF(), which can be useful if you
are concerned about function nesting.

=29*or(O8<"February",day(date(S8,3,0))=29)

=31*and(O8<{"February","September","April","June" ,"November"})

Note the change to AND(<) in the latter formula. Alternatively, you can
keep the original logic and use the following arcane formulation:

=31-31*or(O8={"February","September","April","June","N ovember"})


----- original message -----

"BadBoy" wrote in message
...
Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell
S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in
cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Leap Year

Wonderful work!

Thank you very much. Your formulas have worked very well.

I thank you so much!

-Bad


"BadBoy" wrote:

Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Leap Year

Wonderful work!

Thank you very much. Your formulas have worked very well.

I thank you so much!

-Bad


"JoeU2004" wrote:

"BadBoy" wrote:
If February is in cell O8 and its a leap year, put the number 29 in cell
S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.


=if(or(O8<"February",day(date(S8,3,0))=29),29,0)


if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8


=If (or(O8={"February","September","April","June","Nov ember"}),0,31)

Note: I assume you mean to put this formula in some other cell, not O8
[sic].


FYI, both formulas can be written without IF(), which can be useful if you
are concerned about function nesting.

=29*or(O8<"February",day(date(S8,3,0))=29)

=31*and(O8<{"February","September","April","June" ,"November"})

Note the change to AND(<) in the latter formula. Alternatively, you can
keep the original logic and use the following arcane formulation:

=31-31*or(O8={"February","September","April","June","N ovember"})


----- original message -----

"BadBoy" wrote in message
...
Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell
S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in
cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Leap Year

Wonderful work!

Thank you very much. Your formulas have worked very well.

I thank you so much!

-Bad


"Jacob Skaria" wrote:

Point1:
In which cell are you using your formula. In S8 ?
Or Is the year entered in S8.

Point 2:
Please find the below formula to return 0 or 31.
=IF(O8={"February","September","April","June","Nov ember"},0,31)

If you are looking at returning the days of a month from the "month text"
let me know..


If this post helps click Yes
---------------
Jacob Skaria


"BadBoy" wrote:

Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in cell S8,
if not a leap year, put 0 and if any other month regardless if its a leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Leap Year

"BadBoy" wrote:
"Jacob Skaria" wrote:
=IF(O8={"February","September","April","June","Nov ember"},0,31)


Wonderful work!
Thank you very much. Your formulas have worked very well.


It did?! Did you try anything other than February, e.g. April?

I believe it needs to be:

=IF(OR(O8={"February","September","April","June"," November"}),0,31)


----- original message -----

"BadBoy" wrote in message
...
Wonderful work!

Thank you very much. Your formulas have worked very well.

I thank you so much!

-Bad


"Jacob Skaria" wrote:

Point1:
In which cell are you using your formula. In S8 ?
Or Is the year entered in S8.

Point 2:
Please find the below formula to return 0 or 31.
=IF(O8={"February","September","April","June","Nov ember"},0,31)

If you are looking at returning the days of a month from the "month text"
let me know..


If this post helps click Yes
---------------
Jacob Skaria


"BadBoy" wrote:

Good morning folks,

I have two problems perhaps you may be able to help with.

1) - In the formula below, I wonder if you can help with the following;

If February is in cell O8 and its a leap year, put the number 29 in
cell S8,
if not a leap year, put 0 and if any other month regardless if its a
leap
year or not, put the number 29.

=IF(O8="February",DAY(DATE(S8,3,0)),29)



2) - In the formula below, if any of the months mentioned below are in
cell
O8, place the number 0 in cell O8, otherwise put 31 in cell O8

=If (O8="February","September","April","June","Novembe r",0,31)

Any help you may offer will be much appreciated.

-Bad



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
Leap Year Jet Excel Discussion (Misc queries) 3 March 20th 08 04:17 PM
leap year p-nut Excel Discussion (Misc queries) 5 January 10th 08 05:34 AM
Leap Year Ralph Page Charts and Charting in Excel 3 November 5th 07 01:57 AM
How to determine if year is a leap year Wanda Excel Worksheet Functions 7 September 17th 07 07:48 AM
is 1900 a Leap Year? Lex_Muga Excel Discussion (Misc queries) 11 December 29th 05 07:42 PM


All times are GMT +1. The time now is 05:33 PM.

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

About Us

"It's about Microsoft Excel"