help with formula

J

Juco

I have in cell N19 the formula below. I am trying get it to put in cell N19
the following
if H8 =2 then N19 = £50, if H8 = 3 then N19=£75, if H8 = 1 then N19 =£0
I have tried to amend a previous formula but with little success.

=IF(H8="3",75,)

help appreciated
thanks
 
B

Bob Phillips

=CHOOSE(H8,0,50,75)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

joeu2004

Juco said:
I have in cell N19 the formula below.
I am trying get it to put in cell N19 the following
if H8 =2 then N19 = £50, if H8 = 3 then N19=£75, if H8 = 1then N19 =£0
I have tried to amend a previous formula but with little success.
=IF(H8="3",75,)

=if(h8 = 2, 50, if(h8 = 3, 75, 0))

Please note that 2 and 3 are not quoted. Quoting
"2" and "3" are strings, not values.

That formula returns 0 if h8 is anything other than
2 or 3, not just when h8 = 1. If you want something
else for the h8 <> 1 case, you can do:

=if(h8 = 2, 50, if(h8 = 3, 75, if(h8 = 1, 0, -1)))

substituting whatever value you want for -1.

(Note: -1 is probably a poor choice. But it depends
on your application.)

I think this shows you, in general, how to "amend"
your original formula. However, some of the other
responses show more elegant approaches, which may or
may not work as well, depending on your requirements.
 
G

Gord Dibben

Juco

If those are the only choices use this in N19

=CHOOSE(H8,0,50,75,"invalid number")

1 = 0
2 = 50
3 = 75


Gord Dibben Excel MVP
 

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

Top