Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Format Cells to show different values

I currently have this format for my cells in a list - "In "#,##0"
Day(s)";#,##0" Day(s) ago" I would like to be able to show the text
"Today" if the cell value is zero. Also, if possible, I'd like to get
rid of the "(s)" ie if the value is more than 1 or less than -1 it
should say "Days" and say "Day" if equal to 1 or -1.

Also, can someone point me in the direction of a help file/website for
advanced formatting like this..

Thanks
Tony

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default Format Cells to show different values

I don't think you'll be able to get rid of the (s) just with formatting, you
don't get enough options, but you can add a condition for zero just by
changing to

"In "#,##0" Day(s)";#,##0" Day(s) ago";"Today"

"bony_tony" wrote:

I currently have this format for my cells in a list - "In "#,##0"
Day(s)";#,##0" Day(s) ago" I would like to be able to show the text
"Today" if the cell value is zero. Also, if possible, I'd like to get
rid of the "(s)" ie if the value is more than 1 or less than -1 it
should say "Days" and say "Day" if equal to 1 or -1.

Also, can someone point me in the direction of a help file/website for
advanced formatting like this..

Thanks
Tony


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Format Cells to show different values

Hi Tony

There is no way with cell formatting to include or exclude the (s) if
periods greater than 1 day are involved.
You could achieve your result with formulae though.
If you used a helper column which calculated the value and hid this
column, then you could use the following formula to achieve what you
want.
In my case I assumed column A had the calculated days. Adjust to suit.

=IF(A1=0,"Today",
IF(A10,"In "&ROUNDUP(A1,0)&" day"&IF(A11,"s",""),
IF(A1<0,ABS(ROUNDUP(A1,0))&" Day"&IF(A1<-1,"s","")&" ago")))

If you are using the values in further calculations, then obviously this
would have to refer to the hidden column, not your formatted column.


--
Regards

Roger Govier


"bony_tony" wrote in message
ps.com...
I currently have this format for my cells in a list - "In "#,##0"
Day(s)";#,##0" Day(s) ago" I would like to be able to show the text
"Today" if the cell value is zero. Also, if possible, I'd like to get
rid of the "(s)" ie if the value is more than 1 or less than -1 it
should say "Days" and say "Day" if equal to 1 or -1.

Also, can someone point me in the direction of a help file/website for
advanced formatting like this..

Thanks
Tony



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
Calculating only non-empty cells... Jay Excel Worksheet Functions 9 September 22nd 06 03:20 AM
want format cells alignment not format cells font style Jeannie Bean Excel Discussion (Misc queries) 2 February 10th 06 09:31 AM
How do I hide zero values but keep currency format in P.O. form? Mamarita New Users to Excel 4 February 9th 06 11:53 PM
Show cells have been read - linked ufo_pilot Excel Discussion (Misc queries) 0 August 5th 05 04:22 PM
How To Use Cells Without Values in a Formula Roger H. Excel Worksheet Functions 2 April 6th 05 01:01 AM


All times are GMT +1. The time now is 05:16 AM.

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"