View Full Version : IF Statements


ajb_1976
06-18-2008, 04:23 AM
Hi,
I currently have an IF statement that returns a value based on whether or not a value entered in a cell is greater or less than what exists in another cell. The code i am using is

=+IF(D59<H55,"You are "& SUM(H55-D59)&" under the recommended quote price","You are "& SUM(D59-H55)&" over the recommended quote price")

This works fine but the problems is that the values in question are currency amounts yet the IF statement returns the difference as a general number to 4decimal places. - Is there anyway I can add something to the statment to format the calculated difference into currency, or at least to 2dp?

Thanks,
Alan

Brianwarnock
06-18-2008, 05:06 AM
You can insert your currency symbol in the Text part, and use Round(Sum(....),2) for the decimal places, but as the resulting cell format is a string you lose trailing 0s , I think.

Brian

shades
06-18-2008, 08:22 AM
Use the TEXT function, and then you can specify whatever format you want.

Brianwarnock
06-18-2008, 08:48 AM
Hey that's good Rich, not used that.

Brian

lemo
06-30-2008, 01:07 PM
what if you just format the cell with your formula to whatever format you need?
i feel like it should work just fine.. although sounds a bit trivial.. maybe i'm missing something..
let us know.
l

lemo
06-30-2008, 01:17 PM
duh, of course i am missing something! a complex output..
nevermind, TEXT it is.. something like TEXT(SUM(H55-D59),"$.00")..
it's monday..
l