Formula help

Soldato
Joined
7 Jan 2003
Posts
4,458
Location
Gold Coast, Australia
Ok I need a formula in excel to round a variable cell.

I need it to work like this in a hidden cell; if cell x = kwd then cell y has 8 decimal places but if cell x is anything else then cell y needs to be 7 decimals. But cell y needs to be alterable.
 
Forum subsection fail but I'm a nice guy...

You probably need a cell Z then, assuming you want to avoid using macros.

So

- in cell X you have "kwd"
- in cell Y you put: =IF(cell X="kwd",TEXT(cell Z,"#,##0.00000000"),TEXT(cell Z,"#,##0.0000000"))
- in cell Z you put the value that you want to be alterable

I think that should work.
 
Circular references for the Fail.

You need another cell to hold the final value the you can use:

A1 = 0.23234345 (whatever)
B1 = twp
C1 = =ROUND(A1,IF(B1="twp",8,7))

[edit] drat beaten by Robbie[/edit]
 
Last edited:
If you just want the number to be displayed as either 7/8 dp as required then I'd use conditional formats. If you want the value of the number to be changed for some reason (for example if you're using it in further calculations) then go with the solutions above

/Ignore - just checked and conditional formats won't let you change number formatting, I just assumed it would although I've never had to do it.
 
Back
Top Bottom