#1
|
|||
|
|||
+IF(RAND()........) confused newbie
Win 7 Ultimate
Office 2007 =IF(RAND()<0.5,"yes","no") I'm trying to get my head round the formula above, but am unsure what part of it means. I know the formula as a whole means that if the randomly generated number is less than 50% then return "yes" & if it's more than 50% then return "no" Where i'm lost is on: (1) 50% of what? & (2) When would I use this function? (that might be a 'piece of string' question) I've just realised that if I put the formula into an otherwise blank worksheet, in a new workbook, it still generates a random list of yes's & no's (!?!)....so again......50% of what? TIA |
#2
|
||||
|
||||
Hit F1 in XL and enter RAND in the textbox, it's all there
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
1. point 5 (.5) is one-half of 1.
2. I don't see any use for this formula |
#4
|
|||
|
|||
Pecoflyer:
thanks, but i already looked at the excel help file & no, it's not "all there" - it doesn't answer either of my questions, that's why i posted my request Kimberly: i know that 0.5 is half of 1......but i'm not sure how that actually answers my question - 50% of what? this is an example from a book i'm using to get the basics of excel, but the explanation is not very clear so, after experimenting with the formula & looking at both the excel help file & googling i thought i'd ask here. to experiment i created a column of numbers (1 - 100) & used the formula. i couldn't see what the <0.5 was doing......the < is an operator, so what's it operating on, what's it actually comparing to 0.5 to to see if it's less than it or not? the results i got didn't seem to relate to the numbers in the column & then i discovered that i get a series of yes's & no's even if i use the formula in a new & otherwise fresh workbook. so, & sorry if i'm labouring the point here, but what is being compared to 0.5 to decide whether to return "yes" or "no"? Thanks Last edited by jeffk; 05-27-2013 at 10:25 AM. |
#5
|
|||
|
|||
Quote:
The result of the RAND function is not being displayed, but is being used inside the logical test of the IF function. The RAND() function returns a number >=0 and <1. It stands to reason then that it would return something less than .5 about half the time. There is no "50% of" anything. There is a random number between 0 and 1. If this time it would be less than .5, your formula returns "yes", otherwise, it returns "no". |
#6
|
|||
|
|||
Thanks
Thank you, that clarifies the issue a bit, though I'm still not sure what you'd use the =IF(RAND().....) function for. Randomly selecting items/people/places in a list, maybe?
Thanks for your time & help, Jeff |
#7
|
||||
|
||||
Exactly, Jeff. Your formula is designed to issue Yes or No on a random basis, averaging Yes about as many times as No. Of course, I don't know why the author wanted that effect in this case.
|
Tags |
functions, rand |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Newbie, need help urgently!!!!!!!!! | Ali | Publisher | 2 | 03-16-2012 07:22 AM |
newbie help please | cjpga | Outlook | 2 | 06-23-2011 01:24 PM |
Range Lookup for Totals? Confused | lawnG | Excel | 1 | 02-01-2011 10:42 AM |
Field Lookup - Confused | lawnG | Word Tables | 1 | 01-31-2011 03:50 PM |
Need Backup/Export - confused! | Robin12265 | Outlook | 2 | 06-04-2006 10:38 AM |