Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 343
Default Return a 3 digit number

The line below returns the day of the year (Julian date) so will return a
number from 1 to 365. Is there any way to get this to always return a 3
digit number? If the number is 1 then I need 001 if it is 45 I need 045 and
if it is 241 then I need 241.

=C4-DATE(YEAR(C4),1,0)

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Return a 3 digit number

Hi,

Try this

=TEXT(C4-DATE(YEAR(C4),1,0),"000")

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Patrick C. Simonds" wrote in message
...
The line below returns the day of the year (Julian date) so will return a
number from 1 to 365. Is there any way to get this to always return a 3
digit number? If the number is 1 then I need 001 if it is 45 I need 045
and if it is 241 then I need 241.

=C4-DATE(YEAR(C4),1,0)


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Return a 3 digit number

You could use a custom number format of 000 however, any leading zeros will
be for *display* purposes only. For example, 045 would be displayed but the
true underlying value of the cell will be 45.

You can use a formula like this:

=TEXT(C4-DATE(YEAR(C4),1,0),"000")

That will return a *TEXT* string in the form 045.

--
Biff
Microsoft Excel MVP


"Patrick C. Simonds" wrote in message
...
The line below returns the day of the year (Julian date) so will return a
number from 1 to 365. Is there any way to get this to always return a 3
digit number? If the number is 1 then I need 001 if it is 45 I need 045
and if it is 241 then I need 241.

=C4-DATE(YEAR(C4),1,0)



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
How to validate a cell to insert from 9 digit number to 13 digit number. ramulu via OfficeKB.com Excel Worksheet Functions 1 February 21st 07 02:32 PM
How to validate a cell to insert from 9 digit number to 13 digit number. ramulu Excel Worksheet Functions 1 February 21st 07 10:00 AM
Color a single digit in a mult-digit number cell Phyllis Excel Discussion (Misc queries) 6 November 17th 05 12:46 AM
How do I identify the 7th digit in a 13 digit number, then establi Catherine Excel Worksheet Functions 7 April 4th 05 06:11 PM
When we enter a 16 digit number (credit card) the last digit chan. ceking Excel Discussion (Misc queries) 5 December 8th 04 11:45 PM


All times are GMT +1. The time now is 07:44 AM.

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"