• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to include text as a true value alongside other data in a nested IF

nooby

New Member
A7~~=RANDBETWEEN(1,54)


B7~~=IF(A7<19,RANDBETWEEN(1,19),IF(AND(A7>18,A7<37),RANDBETWEEN(20,91),IF(A7>36,RANDBETWEEN(92,215),"")))


What I would like to accomplish is displaying a Word or some variable characters along side the random numerical number chosen in B7.


For Example:


If A7<19 display 'Single' and the random number between 1-19

If A7>18 But <37 display 'Double' and the random number between 20-91

If A7>36 display 'Triple' and the random number between 92-215.
 
After the random number:

=IF(A7<19,RANDBETWEEN(1,19)&"Single",IF(AND(A7>18,A7<37),RANDBETWEEN(20,91)&"Double",IF(A7>36,RANDBETWEEN(92,215)&"Triple","")))


Before the random number:

=IF(A7<19,"Single"&RANDBETWEEN(1,19),IF(AND(A7>18,A7<37),"Double"&RANDBETWEEN(20,91),IF(A7>36,"Triple"&RANDBETWEEN(92,215),"")))
 
Indian,


I used =IF(A7<19,"Singles --- "&RANDBETWEEN(1,19),IF(AND(A7>18,A9<37),"Doubles --- "&RANDBETWEEN(20,91),IF(A7>36,"Triples --- "&RANDBETWEEN(92,215),"")))


Sometimes when I recalculate (F9 in 2003, autocalculation is turned off). I get a blank or null value from the function in column B. It appears to only happen when The Value is >18 or <37.


Any suggestions?
 
Indian


Shouldn't your formula be:

=IF(A7<19,"Singles --- "&RANDBETWEEN(1,19),IF(AND(A7>18,A7<37),"Doubles --- "&RANDBETWEEN(20,91),IF(A7>36,"Triples --- "&RANDBETWEEN(92,215),"")))
 
Back
Top