ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Change number format with IF statement (https://www.excelbanter.com/excel-worksheet-functions/130881-re-change-number-format-if-statement.html)

Teethless mama

Change number format with IF statement
 
=IF(A2<--"0:1:00",TEXT(A2,"ss.00"),TEXT(A2,"m:ss.00"))


"Time Bandit" wrote:

Hi,
I am trying to change the way excel displays times based on the value of a
cell.

Example: If a cell is custom formatted to show m:ss.00, I am trying to find
a way to say

IF 9:59.99 THEN format = mm:ss.00

Mostly I am trying to get rid of unwanted zeros to make it easier to read
such that

00:15.25 displays as 15.25
03:15.25 displays as 3:15.25
34:15.25 displays as 34:15.25 (i.e unchanged)

Ideally I want to apply a single formula to all cells.

Your help is appreciated.



All times are GMT +1. The time now is 06:44 PM.

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