Solved

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

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

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

729 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