Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Generating a Julian date, but only showing the last two numbers

Hello
I need to build a sheet for our production people to use that generates a
code date from an entered date in another cell. In one customer's case, I
need to generate a Julian date, but they only use the last two numbers of the
Julian date. The formula I use for regular Julian date generation is :

=TEXT(C160,)&TEXT((C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1),"000")

If I simply delete the first zero in the "000", I only get 2 digits up to
99, but at 100 all three digits are indicated.

Thank you in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Generating a Julian date, but only showing the last two numbers

I not usre what you are asking but I think you want to use a mudular 100
function in your code

=Mod(123,100)


so
from
C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1

to
mod(C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1,100)

"waybomb" wrote:

Hello
I need to build a sheet for our production people to use that generates a
code date from an entered date in another cell. In one customer's case, I
need to generate a Julian date, but they only use the last two numbers of the
Julian date. The formula I use for regular Julian date generation is :

=TEXT(C160,)&TEXT((C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1),"000")

If I simply delete the first zero in the "000", I only get 2 digits up to
99, but at 100 all three digits are indicated.

Thank you in advance!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Generating a Julian date, but only showing the last two number

Hi Joel

The reference cell has today's date in it. With the forumula provided, the
formula cell returns 1/22/00.

What I am looking for is the return of the Julian date (the day's number out
of the 365 days of the year) of 22.

If I type in 6/22/09 into the reference cell, I want the Julian date
returned in the formula cell that only has the last two numbers of the Julian
date. With the formula I posted , the return is 173. But I only want 73 to
be retuned.

If I change the "000" in the forumla I posted to "00", I get only two
numbers shown at or below 99, but as soon as the number is 100 or larger, all
three numbers show up.

Thanks for working with me on this.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Generating a Julian date, but only showing the last two number

=Mod(173,100) will result in 73

"waybomb" wrote:

Hi Joel

The reference cell has today's date in it. With the forumula provided, the
formula cell returns 1/22/00.

What I am looking for is the return of the Julian date (the day's number out
of the 365 days of the year) of 22.

If I type in 6/22/09 into the reference cell, I want the Julian date
returned in the formula cell that only has the last two numbers of the Julian
date. With the formula I posted , the return is 173. But I only want 73 to
be retuned.

If I change the "000" in the forumla I posted to "00", I get only two
numbers shown at or below 99, but as soon as the number is 100 or larger, all
three numbers show up.

Thanks for working with me on this.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Generating a Julian date, but only showing the last two number

Hi again Joel

Here's the fomula I put in now:
=TEXT(C160,)&TEXT(MOD(C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1,100),"000")

What this returns when the reference cell is 6/22/09 is 073. All I want
returned is 73.

How do I drop the zero?

Thanks
Fred



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Generating a Julian date, but only showing the last two number

Hi Joel

Disregard that last reply. I figured it out. here's my new fomula that works!
=TEXT(C160,)&TEXT(MOD(C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1,100),"00")


THANKS!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Generating a Julian date, but only showing the last two number

This is a little shorter and uses less function calls...

=MOD(1+C16-DATE(YEAR(C16),1,1),100)

--
Rick (MVP - Excel)


"waybomb" wrote in message
...
Hi Joel

Disregard that last reply. I figured it out. here's my new fomula that
works!
=TEXT(C160,)&TEXT(MOD(C160-DATEVALUE("1/1/"&TEXT(C160,"yy"))+1,100),"00")


THANKS!


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Generating a Julian date, but only showing the last two number

Hi Rick

I tried that, but if the three digit Julain ends in 01, 02, 03, etc, all
that is returned is 1, 2, 3, etc.

If it ends in 11, 12, 13, etc, that's what the formula returns.

I do need two numbers, even if the first is a zero.
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Generating a Julian date, but only showing the last two number

You could Custom Format your cell(s) to show 2-digits using 00 as the format
pattern.

--
Rick (MVP - Excel)


"waybomb" wrote in message
...
Hi Rick

I tried that, but if the three digit Julain ends in 01, 02, 03, etc, all
that is returned is 1, 2, 3, etc.

If it ends in 11, 12, 13, etc, that's what the formula returns.

I do need two numbers, even if the first is a zero.


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Generating a Julian date, but only showing the last two number

Or, instead of custom formatting (as per my other post in this sub-thread),
you could leave the cell format as General and use this formula (still
shorter than yours and also still using less function calls)...

=RIGHT(1+C16-DATE(YEAR(C16),1,1),2)

--
Rick (MVP - Excel)


"waybomb" wrote in message
...
Hi Rick

I tried that, but if the three digit Julain ends in 01, 02, 03, etc, all
that is returned is 1, 2, 3, etc.

If it ends in 11, 12, 13, etc, that's what the formula returns.

I do need two numbers, even if the first is a zero.


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
Julian date - find next highest date/number jchick0909 Excel Worksheet Functions 1 March 20th 08 11:38 PM
Change satellite julian date format YYYYDDDHHMMSS to excel date ti putley Excel Discussion (Misc queries) 1 January 11th 08 06:12 PM
Julian day numbers ZachB Excel Discussion (Misc queries) 1 June 27th 07 05:13 PM
Convert a julian gregorian date code into a regular date Robert Excel Worksheet Functions 3 June 13th 06 07:03 PM
how to convert julian date to regular calendar date Ron Excel Worksheet Functions 5 May 5th 05 11:05 PM


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