SQLScholar
Programmer
Hey all,
If i have 2 values... either of which could be bigger, either of which could be 0. I want to do something like this.
If both values are 0, then put 0:0.
If value 1 is 0 put 0:value2
If value 2 is 0 put value1:0
If then value 1 is greater then put value1/value2:1
If then value 2 is greater then put 1:value1/value2
This is where i am stuck. Currently this all includes rounding to 0 DP. I want to have all this, but also if the value used in the non written bit of the equation is less then 2 put the rounding to 1 DP.
I dont want everything rounded... but a few 1:1`s when there shouldnt be look stupid. Current code below
sorry for being a tad complex.
TIA
Dan
----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
If i have 2 values... either of which could be bigger, either of which could be 0. I want to do something like this.
If both values are 0, then put 0:0.
If value 1 is 0 put 0:value2
If value 2 is 0 put value1:0
If then value 1 is greater then put value1/value2:1
If then value 2 is greater then put 1:value1/value2
This is where i am stuck. Currently this all includes rounding to 0 DP. I want to have all this, but also if the value used in the non written bit of the equation is less then 2 put the rounding to 1 DP.
I dont want everything rounded... but a few 1:1`s when there shouldnt be look stupid. Current code below
Code:
=IF(AND(C7="",C33<>""),"0:"&C33,IF(C33="","",IF(C33=0,C7&":0",IF(C7/C33<1,"1:"&ROUND(C33/C7,0),ROUND(C7/C33,0)&":1"))))
sorry for being a tad complex.
TIA
Dan
----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!