Solved

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

Posted on 2013-12-16
4
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vlookup - 2 criteria 6 44
Excel IF statement 4 23
VB.Net  Exporting Excel Woorkbook to PDF 7 60
Count number of rows containing same number is Column A 8 33
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

726 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