Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

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

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
ExpExchHelp
Asked:
ExpExchHelp
  • 2
1 Solution
 
NorieCommented:
You could try this.

=IF(RAND()>0.5, -1, 1)
0
 
ExpExchHelpAuthor Commented:
Awesome... thanks for the prompt response!

EEH
0
 
Saqib Husain, SyedEngineerCommented:
Another option although the question is closed

=2*INT(RAND()*2)-1
0
 
ExpExchHelpAuthor Commented:
ssaqibh -- thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now