Essentially, I want to have a random + or - so I'm using a RandBetween(-1,1). However, when the value is value is zero, I obviously get the same number I started off with. Is there a way to exclude the zero?
Thanks in advance!
Excel Example:
=J1+(J1*RAND()*RANDBETWEEN(-1,1)*0.1)
This will select 1 or -1 with 50% probability:
=IF(RAND()<0.5, 1, -1)
For fun, here is a different solution which uses RandBetween:
=(-1)^RANDBETWEEN(0,1)
Related
I'm trying to do some transformation with numbers in excel. First i have that table:
And as you can see, i have Random Digits, which is generated by using RANDBETWEEN. Now i want the Column Type, to be automatically Generated. So for example if Random Digits is:
From 1 - 35 = Good
36 - 80 = Fair
81 - 100 = Poor
I was already trying with IF function, but with if function i'm able to generate only 2 values and not 3.
Thank you for answers.
INDEX and MATCH are a good way to avoid nesting lots of IF statements (generally to be avoided!):
=INDEX({"Good","Fair","Poor"},MATCH(B2,{0,36,81},1))
If you really wanted to use an IF statement, it would look like this:
=IF(B2<36,"Good",IF(B2<81,"Fair","Poor"))
Nest the If so where you get the true value just output what you need but if its false then just write another if statement...
Use one IF inside another IF like this:
=if('From 1 - 35';'thing to do if is true';if('36 - 80';'thing to do if is true';'thing to do when is 81 - 100'))
The excel formula you are looking for is
=IF(B1>100,"error",IF(B1>=81,"Poor",IF(B1>=36,"Fair",IF(B1>=1,"Good","error"))))
This will display the word "error" if you range is >100 or <1. Other answers have failed to address the cases where the number is >100 or <1, as the question specifically bounds the set of responses to be between 1 and 100.
The formula works as a nested if statement. In pseudo code the formula is equivalent to:
if(B1>100)
then "Error"
Else if (B1>=81)
then "Poor"
Else if (B1>=36)
then "Fair"
Else if (B1>=1)
then "Good"
else
"Error"
I've been struggling to get this formula to work. I have a spreadsheet where I need to find out how many of one column (BH2:BH915) contain a value (X) if another column (N2:N915) contains either 1 or 0. I've tried a bunch of versions to get it to work - this is the latest:
=sum(countifs(N2:N915="1","0") and (BH2:BH915="X"))
Can anyone tell me where I'm going wrong?
You'll need to add together the count of records with 0 and X and the count of records with 1 and X
=COUNTIFS(N2:N915, 0, BH2:BH915, "X") + COUNTIFS(N2:N915, 1, BH2:BH915, "X")
You could also use
=SUM(COUNTIFS(BH2:BH915,"x",N2:N915,{0,1}))
or if you knew that the numbers in N2:N915 were integers
=COUNTIFS(BH2:BH915,"x",N2:N915,">="&0,N2:N915,"<="&1)
I was doing R&D on Excel. And wanted to use If-else ladder in column of excel.
Let's say I have a 2 columns and I calculated the difference between the two columns. Now, If the difference is between a range of (-5 to +5), if should display something or if Difference greater than 5, it should display something and for rest i.e. difference < -5, should display something else.
I tried and came up with this
=IF("H2>5",<something1>, IF("H2<5",<something2>))
How to put the range part in this if-else ladder? Also the above If else is not giving value but the result is turning out to be #VALUE.
Thanks for your help.
Try
=IF(H2<-5,"Negative",IF(H2<=5,"In Range","Positive"))
There could be 3 possibilities only, 1 the answer is between -5 to 5 inculdining -5 and 5. 2 greater then 5. 3 smaller than -5. so this should work
=IF(AND(H2>=-5,H2<=5),"between -5 &5",IF(H2<-5,"Smaller than-5",IF(H2>5,"greater than 5 ")))
let me know if this is what is required.
I have the following columns in Excel
a b c
1 SUM 1st 2nd
2 0 2/2 2/4
3 0 1/1 3/4
b2 is defined as "=CONCATENATE(TRUNC(2);"/";TEXT(('Other sheet'!B2);0))"
and similar to b3,c2,c3.
Column |SUM| should count sum from |1st| to |2nd| but only the first numbers before "/".
for example: b2+c3+... = 2+2+... = 4+... so a2=4+...
any ideas how to do that? :)
Use the below formula with feature shift+ctrl+enter:
=SUM(TRUNC(MID(B2:C2,1,SEARCH("/",B2:C2,1)-1)))
You can use the 'left' function
Use it like this
A2=left(B2;1)+left(C2;1)
Here's a simple way to do it
=SUMPRODUCT(INT(SUBSTITUTE(B2:C2,"/",".")))
Extend your range as far as you need by changing B2:C2 to B2:X2, for example.
I think this might work for your system.
=SUMA.ILOCZYNÓW(ZAOKR.DO.CAŁK(PODSTAW(B2:C2;"/";".")))
I have a list of points that need to be assigned in to a certain tier. For example:
<1250 = Tier 1
1250-1650 = Tier 2
>1650 = Tier 3
I've been trying to use this formula:
=IF(AND(B2 > 0,B2 < 1250),"1",IF(AND(B2 > 1250,B2 < 1650),"2",IF(AND(B2 > 1650,B2 < 2000),"3")))
The problem is that when a value is 1250 "FALSE" is returned, I can't seem to figure out how to fix this. Any help would be much appreciated.
=IF(B2<1250,"1",IF(AND(B2>=1250,B2<=1650),"2",IF(B2>1650,"3")))
Note that this will also populate cells with 1 if there's no number in the corresponding B cell.
You need to add some equal signs to your inner and statement (AND(B8 >= 1250,B8 <= 1650)
One thing to note is that you could also use this.
=IF(B2<1250,"1",IF(B2<=1650,"2","3"))