Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-27-2013, 06:24 AM
jeffk jeffk is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2007
Advanced Beginner
+IF(RAND()........)   confused newbie
 
Join Date: Jul 2012
Location: North of England, UK
Posts: 33
jeffk is on a distinguished road
Default +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
Reply With Quote
  #2  
Old 05-27-2013, 07:37 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

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
Reply With Quote
  #3  
Old 05-27-2013, 07:38 AM
Kimberly Kimberly is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default

1. point 5 (.5) is one-half of 1.
2. I don't see any use for this formula
Reply With Quote
  #4  
Old 05-27-2013, 08:28 AM
jeffk jeffk is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2007
Advanced Beginner
+IF(RAND()........)   confused newbie
 
Join Date: Jul 2012
Location: North of England, UK
Posts: 33
jeffk is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 05-27-2013, 05:26 PM
Kimberly Kimberly is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default

Quote:
what is being compared to 0.5 to decide whether to return "yes" or "no"?
The result of the RAND function.

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".
Reply With Quote
  #6  
Old 05-28-2013, 02:01 AM
jeffk jeffk is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2007
Advanced Beginner
+IF(RAND()........)   confused newbie
 
Join Date: Jul 2012
Location: North of England, UK
Posts: 33
jeffk is on a distinguished road
Default 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
Reply With Quote
  #7  
Old 05-28-2013, 08:03 AM
BobBridges's Avatar
BobBridges BobBridges is offline +IF(RAND()........)   confused newbie Windows 7 64bit +IF(RAND()........)   confused newbie Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

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.
Reply With Quote
Reply

Tags
functions, rand



Similar Threads
Thread Thread Starter Forum Replies Last Post
+IF(RAND()........)   confused newbie Newbie, need help urgently!!!!!!!!! Ali Publisher 2 03-16-2012 07:22 AM
+IF(RAND()........)   confused newbie newbie help please cjpga Outlook 2 06-23-2011 01:24 PM
+IF(RAND()........)   confused newbie Range Lookup for Totals? Confused lawnG Excel 1 02-01-2011 10:42 AM
+IF(RAND()........)   confused newbie Field Lookup - Confused lawnG Word Tables 1 01-31-2011 03:50 PM
+IF(RAND()........)   confused newbie Need Backup/Export - confused! Robin12265 Outlook 2 06-04-2006 10:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft