Solved

Excel -- random number... either -1 or 1

Posted on 2013-12-16
4
224 Views
Last Modified: 2013-12-17
Experts:

I need a random number function that gives me only two values:  -1 or 1

Below rand function also generates three values: -1, 0, 1  

=RAND()*((-1)^INT(RAND()*10))

How should this function to be modified to only get -1 and 1?

EEH
0
Comment
Question by:ExpExchHelp
  • 2
4 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
Comment Utility
You could try this.

=IF(RAND()>0.5, -1, 1)
0
 

Author Closing Comment

by:ExpExchHelp
Comment Utility
Awesome... thanks for the prompt response!

EEH
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
Comment Utility
Another option although the question is closed

=2*INT(RAND()*2)-1
0
 

Author Comment

by:ExpExchHelp
Comment Utility
ssaqibh -- thanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now