Solved

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

Posted on 2013-12-16
4
237 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
ID: 39721760
You could try this.

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

Author Closing Comment

by:ExpExchHelp
ID: 39721763
Awesome... thanks for the prompt response!

EEH
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39721820
Another option although the question is closed

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

Author Comment

by:ExpExchHelp
ID: 39724208
ssaqibh -- thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add a range in an Excel graph 5 36
Excel Hyperlink Question 4 32
simple vba query 9 23
Excel VBA - Use of double quotes in string 8 0
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

862 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

24 Experts available now in Live!

Get 1:1 Help Now