I
Ithaca
I'm trying to create a spreadsheet at work that used for reporting test
results but I've run into a potential problem.
The actual results are simple with an IF statement comparing an average (A1)
to a specification (S1) and reporting the average if its below the
specification or "Fail" if it's above the spec. It looks like this:
=IF(A1<=S1, A1, "Fail")
The specification varies from a whole number to a decimal, depending on the
sample tested. If the spec is 5 then what I'm actually using in the equation
is 5.49 such that, when rounded to the correct level of precision, the result
is "not more than" then given spec. If the spec is 0.2 then the value in the
equation would be 0.249.
The problem is that I'd like to make this one spreadsheet work for all
samples and therefore all specifications (5 to 0.2) and the quick formulas I
know of won't work for something that changes the level of precision.
Is there a way to determine the number of decimal places in a cell such that
"if S1 has 0 decimals then yield this result"?
I've tried the function ROUND( but I can't float the decimal (at least I
don't know how to). If I were able to get that function to round to the
level specified in S1 then that might work...
results but I've run into a potential problem.
The actual results are simple with an IF statement comparing an average (A1)
to a specification (S1) and reporting the average if its below the
specification or "Fail" if it's above the spec. It looks like this:
=IF(A1<=S1, A1, "Fail")
The specification varies from a whole number to a decimal, depending on the
sample tested. If the spec is 5 then what I'm actually using in the equation
is 5.49 such that, when rounded to the correct level of precision, the result
is "not more than" then given spec. If the spec is 0.2 then the value in the
equation would be 0.249.
The problem is that I'd like to make this one spreadsheet work for all
samples and therefore all specifications (5 to 0.2) and the quick formulas I
know of won't work for something that changes the level of precision.
Is there a way to determine the number of decimal places in a cell such that
"if S1 has 0 decimals then yield this result"?
I've tried the function ROUND( but I can't float the decimal (at least I
don't know how to). If I were able to get that function to round to the
level specified in S1 then that might work...