Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Custom Number Format with Text as formula

I want to format a cell to return a number value with a text, depending on
what the value of the number is.
For example if A1 contains the value 4.1%, then I want to use a formula in
B1 to read "4.1% more work days", if the number in A1 is negative, I need B1
to read "4.1 fewer work days". The catch is that I also want to add
additional text, based on an if then statement which I can add with no
problem. Therefore, I cannot simply use a custom number format in the cell
format, and need to use a formula. My challenge is formatting using the
following as a starting point:

=TEXT(A1,"##.##%_more;##.##%_more")&" workdays".

Unfortunately, this formula does not work, and I am not sure what I am
missing. Any help would be much appreciated.

Thanks much
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Custom Number Format with Text as formula

One way:

=TEXT(A1,"##.##% ")&IF(A1<0,"fewer","more") & " workdays"


In article ,
mzehr wrote:

I want to format a cell to return a number value with a text, depending on
what the value of the number is.
For example if A1 contains the value 4.1%, then I want to use a formula in
B1 to read "4.1% more work days", if the number in A1 is negative, I need B1
to read "4.1 fewer work days". The catch is that I also want to add
additional text, based on an if then statement which I can add with no
problem. Therefore, I cannot simply use a custom number format in the cell
format, and need to use a formula. My challenge is formatting using the
following as a starting point:

=TEXT(A1,"##.##%_more;##.##%_more")&" workdays".

Unfortunately, this formula does not work, and I am not sure what I am
missing. Any help would be much appreciated.

Thanks much

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Custom Number Format with Text as formula

On Mon, 14 May 2007 11:04:01 -0700, mzehr
wrote:

I want to format a cell to return a number value with a text, depending on
what the value of the number is.
For example if A1 contains the value 4.1%, then I want to use a formula in
B1 to read "4.1% more work days", if the number in A1 is negative, I need B1
to read "4.1 fewer work days". The catch is that I also want to add
additional text, based on an if then statement which I can add with no
problem. Therefore, I cannot simply use a custom number format in the cell
format, and need to use a formula. My challenge is formatting using the
following as a starting point:

=TEXT(A1,"##.##%_more;##.##%_more")&" workdays".

Unfortunately, this formula does not work, and I am not sure what I am
missing. Any help would be much appreciated.

Thanks much


You're actually pretty close. You need to set up your format as a conditional
format string. So something like:

=TEXT(A1,"[0]##.##%"" more"";[<0]##.##%"" fewer""")&" workdays"

might give you the more/fewer depending on the value in A1.

You'll need to decide what you want to do if the contents of A1 is zero or
blank, and make the appropriate changes in the TEXT function format statement
--ron
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Custom Number Format with Text as formula

Ron,
Fantastic! That was exactly what I was looking for! Thanks for your help.
Mike

"Ron Rosenfeld" wrote:

On Mon, 14 May 2007 11:04:01 -0700, mzehr
wrote:

I want to format a cell to return a number value with a text, depending on
what the value of the number is.
For example if A1 contains the value 4.1%, then I want to use a formula in
B1 to read "4.1% more work days", if the number in A1 is negative, I need B1
to read "4.1 fewer work days". The catch is that I also want to add
additional text, based on an if then statement which I can add with no
problem. Therefore, I cannot simply use a custom number format in the cell
format, and need to use a formula. My challenge is formatting using the
following as a starting point:

=TEXT(A1,"##.##%_more;##.##%_more")&" workdays".

Unfortunately, this formula does not work, and I am not sure what I am
missing. Any help would be much appreciated.

Thanks much


You're actually pretty close. You need to set up your format as a conditional
format string. So something like:

=TEXT(A1,"[0]##.##%"" more"";[<0]##.##%"" fewer""")&" workdays"

might give you the more/fewer depending on the value in A1.

You'll need to decide what you want to do if the contents of A1 is zero or
blank, and make the appropriate changes in the TEXT function format statement
--ron

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Custom Number Format with Text as formula

Thanks JE. While your response will also work, and is very helpful, Ron's
response was exactly what I was looking for. I was having trouble getting
the text qualifier formated properly. I appreciate your time in responding!

"JE McGimpsey" wrote:

One way:

=TEXT(A1,"##.##% ")&IF(A1<0,"fewer","more") & " workdays"


In article ,
mzehr wrote:

I want to format a cell to return a number value with a text, depending on
what the value of the number is.
For example if A1 contains the value 4.1%, then I want to use a formula in
B1 to read "4.1% more work days", if the number in A1 is negative, I need B1
to read "4.1 fewer work days". The catch is that I also want to add
additional text, based on an if then statement which I can add with no
problem. Therefore, I cannot simply use a custom number format in the cell
format, and need to use a formula. My challenge is formatting using the
following as a starting point:

=TEXT(A1,"##.##%_more;##.##%_more")&" workdays".

Unfortunately, this formula does not work, and I am not sure what I am
missing. Any help would be much appreciated.

Thanks much




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Custom Number Format with Text as formula

On Mon, 14 May 2007 12:27:02 -0700, mzehr
wrote:

Ron,
Fantastic! That was exactly what I was looking for! Thanks for your help.
Mike


You're welcome. Glad to help. Thanks for the feedback.
--ron
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
custom number and random text format CAD Teacher Excel Discussion (Misc queries) 0 June 21st 06 11:56 AM
how do I add phone number format as a permanent custom format? frustratedagain Excel Discussion (Misc queries) 3 February 4th 06 03:52 AM
Format a cell with a custom number format Armor Excel Worksheet Functions 4 January 29th 06 11:25 PM
Custom Number Format Text Frank & Pam Hayes Excel Discussion (Misc queries) 3 December 3rd 05 05:36 PM
change custom format number to text joey Excel Discussion (Misc queries) 3 September 20th 05 09:35 PM


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