Solved

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

Posted on 2013-12-16
4
245 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delete all empty columns using VBA 7 42
how to add loop into this VBA 3 29
Excel - conditional formatting on several columns 9 38
Formula Help 3 23
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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 a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

803 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