I needed some help trying to build a formula...
say I have 3 columns, A, B, and C.
I have the forum in C that: =B1*(RAND()*(0.95-0.85))
But now if A1 = EVEN, I need to be sure that the result of that calculation (C1) is even, and if C1 isn't even, then add +0.01 to it so that it is.
Is it possible to add this functionality into a formula that I can just plug into C1 and drag down as needed?
how are you determining even/odd? is 0.14754263
considered odd? if so adding 0.01 wont make it even
how many decimal places are you considering?
=ROUND(B1*(RAND()*(0.95-0.85)),2) will narrow it down a bit
Last edited by martindwilson; 11-10-2011 at 07:31 PM.
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
Perhaps try a formula like this
=CEILING(ROUND(B1*RAND()/10,2),((A1="EVEN")+1)/100)
If A1 is EVEN then the result will be divisble by 0.02, if not then it may not be....
format to 2 decimal places
Audere est facere
or
=IF(AND(ISEVEN(A1),ISODD(100*ROUND(B1*(E1*(0.95-0.85)),2))),ROUND(B1*(E1*(0.95-0.85)),2)+0.01,ROUND(B1*(E1*(0.95-0.85)),2)) where e1 contains rand()
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks