#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Mod function

I'm doing a date calculation where by 1 is January 1900, 2 is February 1900,
.... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Mod function

=Month(1/1/1900) would extract 1 from 1/1/1900, etc.

Dave
--
Brevity is the soul of wit.


"Brad" wrote:

I'm doing a date calculation where by 1 is January 1900, 2 is February 1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Mod function

Try:

=MOD(H3-1,12)+1

"Brad" wrote:

I'm doing a date calculation where by 1 is January 1900, 2 is February 1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Mod function

Is this homework? Try this
=MOD(H3-1,12)+1
and think why it works
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Brad" wrote in message
...
I'm doing a date calculation where by 1 is January 1900, 2 is February
1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use
an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Mod function

Thanks - Tuesday morning after a three day weekend - shoulda seen that one
myself

"Toppers" wrote:

Try:

=MOD(H3-1,12)+1

"Brad" wrote:

I'm doing a date calculation where by 1 is January 1900, 2 is February 1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Mod function

Thanks - not homework - shoulda seen this one myself.

"Bernard Liengme" wrote:

Is this homework? Try this
=MOD(H3-1,12)+1
and think why it works
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Brad" wrote in message
...
I'm doing a date calculation where by 1 is January 1900, 2 is February
1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use
an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Mod function

I don't remember saying thanks - so Thank you.

"Toppers" wrote:

Try:

=MOD(H3-1,12)+1

"Brad" wrote:

I'm doing a date calculation where by 1 is January 1900, 2 is February 1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Mod function

Appreciate the feedback.

"Brad" wrote:

I don't remember saying thanks - so Thank you.

"Toppers" wrote:

Try:

=MOD(H3-1,12)+1

"Brad" wrote:

I'm doing a date calculation where by 1 is January 1900, 2 is February 1900,
... 1281 is September 2006. I want to extract the month from the number.
The following works - but is there a better way (where I don't have to use an
IF)?

=IF(MOD(H3,12)<0,MOD(H3,12),12)

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
Need some comments on my Utility_Move class module. jchen Excel Worksheet Functions 0 August 21st 06 07:05 PM
Creating a Custom Excel Function to Calculate Gini Coefficients [email protected] Excel Worksheet Functions 3 February 21st 06 10:15 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 09:50 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"