ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   2 decimal cell (https://www.excelbanter.com/excel-discussion-misc-queries/229648-2-decimal-cell.html)

Mukesh

2 decimal cell
 
Is it possible to get 2 decimal cell using IF or any formula?
for example if cell A1 has or is "abc", cell A2 should be 2 decimal.

Thanks.
Mukesh




Jacob Skaria

2 decimal cell
 
Try this from VBE immediate window..

If Range("A1") = "abc" Then Range("A2").NumberFormat = "0.00"

If this post helps click Yes
---------------
Jacob Skaria


"Mukesh" wrote:

Is it possible to get 2 decimal cell using IF or any formula?
for example if cell A1 has or is "abc", cell A2 should be 2 decimal.

Thanks.
Mukesh




Jacob Skaria

2 decimal cell
 
Suppose you have

A1 = abc
B1 = 1.678

Enter this formula in A2
=IF(A1="abc",ROUND(B1,2),B1)


If this post helps click Yes
---------------
Jacob Skaria


"Mukesh" wrote:

Is it possible to get 2 decimal cell using IF or any formula?
for example if cell A1 has or is "abc", cell A2 should be 2 decimal.

Thanks.
Mukesh





All times are GMT +1. The time now is 03:45 AM.

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