Donate SIGN UP

Excel

Avatar Image
MarkyP05 | 22:12 Wed 19th Aug 2009 | Technology
10 Answers
Formula based question

Which function do i use so that a specific cell produces a "20" if the random number produced in a different field matches a certain set of predefined numbers and a "0" if not.

thanks in advance
Gravatar

Answers

1 to 10 of 10rss feed

Best Answer

No best answer has yet been selected by MarkyP05. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
Question Author
ive attempted to use that function... but to no avail

ive tried =IF((B1=A1,A2,A3),"20","0")

with A1, A2, A3 being the pre-defined numbers AND B1 being the random number but its not accepting it
Are your brackets right- are you sure the brackets should surround everything that follows?
Try this:

=IF(OR(B1=A1,B1=A2,B1=A3),20,0)

You seemed to be coding an AND condition.
also unless you are planning on never changing the numbers you'd be better off putting them in separate cells and referencing the cells in the formula rather than having the numbers in the formula.
chuck, look closely we are referencing the cells! They are A1/A2/A3.
DOh!

I was tired, it was late :)
Have you tried if(B1=A1) OR (B1=A2) OR (B1=A3) inside the formula?
that's what I coded dippy
Question Author
worked a treat. thanks.

1 to 10 of 10rss feed

Do you know the answer?

Excel

Answer Question >>