Is a multiple if-then formula possible?

B

bortz

What I'm trying to do is figure out an excel formula that does th
following:

IF user enters the numbers 3 or 4 or 5 or 6 in field A3, put a 0 i
cell B3 and
IF user enters the number 7 or 8 in A3, put a -1 in cell B3
IF user enters the number 9 or 10 or 11 or 12, put a -2 in cell B3
No user entry below the digit 3 or above the digit 12 will be entere
by the user.

Any help will be greatly appreciated. I have to go take some Tyleno
now :
 
B

BenjieLop

bortz said:
What I'm trying to do is figure out an excel formula that does th
following:

IF user enters the numbers 3 or 4 or 5 or 6 in field A3, put a 0 i
cell B3 and
IF user enters the number 7 or 8 in A3, put a -1 in cell B3
IF user enters the number 9 or 10 or 11 or 12, put a -2 in cell B3
No user entry below the digit 3 or above the digit 12 will be entere
by the user.

Any help will be greatly appreciated. I have to go take some Tyleno
now :)

Try this ...

=IF(AND(A3>=3,A3<=6),0,IF(OR(A3=7,A3=8),-1,IF(AND(A3>=9,A3<=12),-2,\"INVALI
NUMBER ENTERED\"))

Hope this is what you need.

Regards
 
A

AS

As Andy said works great, you could also force a whole number entry between
3 & 12 with data validation.
Allan
 
R

RagDyeR

If I understand what you're asking, you'll need a formula in B3 to evaluate
the entry in A3, and you'll need a validation in A3 to restrict which
entries are allowed.

In B3 enter:

=IF(A3<>"",IF(OR(A3={7,8}),-1,IF(OR(A3={9,10,11,12}),-2,0)),"")

Now, select A3, then:

<Data> <Validation>

In the "Allow" box, click "Custom", and enter this formula:

=AND(A3>=3,A3<=12)

Then <OK>.

--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================



What I'm trying to do is figure out an excel formula that does the
following:

IF user enters the numbers 3 or 4 or 5 or 6 in field A3, put a 0 in
cell B3 and
IF user enters the number 7 or 8 in A3, put a -1 in cell B3
IF user enters the number 9 or 10 or 11 or 12, put a -2 in cell B3
No user entry below the digit 3 or above the digit 12 will be entered
by the user.

Any help will be greatly appreciated. I have to go take some Tylenol
now :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top