ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional formatting - sort of (https://www.excelbanter.com/excel-worksheet-functions/216848-conditional-formatting-sort.html)

kafter244

Conditional formatting - sort of
 
I am using VLOOKUP to find a "time" result from a "height" input, and (in
another condition) the reverse of this.

The input and output cells work in both circumstances, however I must change
the number formatting each time to reflect wether I am inputting (or
returning) a time ("00:00") or a regular integer (0.00).

Is there a function I can use whereby I do not need to change this
formatting...or the formatting changes itself relative to the same condition
as the formula?

FSt1

Conditional formatting - sort of
 
hi
conditional formating can't change number formating. it is restricted to
back color, font color, borders, and the font itself. it has no ability to
change number formating ie date, time, currency, decimals ect. your best bet
is to have the results returned in two different cells so that each could be
formated different. otherwize you are looking at a macro and i'm not sure
that would work either since a change in formula does not constitute a
worksheet change event. maybe the calculation event.

Regards
FSt1

"kafter244" wrote:

I am using VLOOKUP to find a "time" result from a "height" input, and (in
another condition) the reverse of this.

The input and output cells work in both circumstances, however I must change
the number formatting each time to reflect wether I am inputting (or
returning) a time ("00:00") or a regular integer (0.00).

Is there a function I can use whereby I do not need to change this
formatting...or the formatting changes itself relative to the same condition
as the formula?


Fred Smith[_4_]

Conditional formatting - sort of
 
It depends on the values you have. A time to Excel is a fraction of a day
(ie, 24 hours = 1). So if, for example, your times are always less than 12
hours, and your heights are always greater than 0.5, you can take advantage
of this by using a custom format like:

[<0.5]h:mm;#,##0.00

This will display all your times as h:mm, and all your heights as 0.00

Regards,
Fred

"kafter244" wrote in message
...
I am using VLOOKUP to find a "time" result from a "height" input, and (in
another condition) the reverse of this.

The input and output cells work in both circumstances, however I must
change
the number formatting each time to reflect wether I am inputting (or
returning) a time ("00:00") or a regular integer (0.00).

Is there a function I can use whereby I do not need to change this
formatting...or the formatting changes itself relative to the same
condition
as the formula?



Victor Lobo

Conditional formatting - sort of
 
Hi

It depends on which version of excel you are using.
Excel 2003 does not support "number formatting" in conditional
formatting
Excel 2007 supports this feature (as mentioned he
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx )

If you are using Excel 2003 maybe this will help you:
http://www.dailydoseofexcel.com/arch...number-format/

Thanks,
Victor



On Jan 17, 9:18*pm, "Fred Smith" wrote:
It depends on the values you have. A time to Excel is a fraction of a day
(ie, 24 hours = 1). So if, for example, your times are always less than 12
hours, and your heights are always greater than 0.5, you can take advantage
of this by using a custom format like:

[<0.5]h:mm;#,##0.00

This will display all your times as h:mm, and all your heights as 0.00

Regards,
Fred

"kafter244" wrote in message

...



I am using VLOOKUP to find a "time" result from a "height" input, and (in
another condition) the reverse of this.


The input and output cells work in both circumstances, however I must
change
the number formatting each time to reflect wether I am inputting (or
returning) a time ("00:00") or a regular integer (0.00).


Is there a function I can use whereby I do not need to change this
formatting...or the formatting changes itself relative to the same
condition
as the formula?



kafter244

Conditional formatting - sort of
 
Wow, thanks a lot for the advice guys, I shall have a read through all the
suggestions now.

Cheers :-)

"Victor Lobo" wrote:

Hi

It depends on which version of excel you are using.
Excel 2003 does not support "number formatting" in conditional
formatting
Excel 2007 supports this feature (as mentioned he
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx )

If you are using Excel 2003 maybe this will help you:
http://www.dailydoseofexcel.com/arch...number-format/

Thanks,
Victor



On Jan 17, 9:18 pm, "Fred Smith" wrote:
It depends on the values you have. A time to Excel is a fraction of a day
(ie, 24 hours = 1). So if, for example, your times are always less than 12
hours, and your heights are always greater than 0.5, you can take advantage
of this by using a custom format like:

[<0.5]h:mm;#,##0.00

This will display all your times as h:mm, and all your heights as 0.00

Regards,
Fred

"kafter244" wrote in message

...



I am using VLOOKUP to find a "time" result from a "height" input, and (in
another condition) the reverse of this.


The input and output cells work in both circumstances, however I must
change
the number formatting each time to reflect wether I am inputting (or
returning) a time ("00:00") or a regular integer (0.00).


Is there a function I can use whereby I do not need to change this
formatting...or the formatting changes itself relative to the same
condition
as the formula?





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com