Syntax with "IF" statement...

G

garry05

Trying to resolve a situation that I've got posted elsewhere on here
maybe I can do it this way if someone can help me with the syntax fo
using "IF".

Say that column G is numbered 1-5, and column H has values of 100, 133
322, 440, 560.

I'll enter a number (1-5) in col A, and I want this to happen in col B
and I'll express it in human language: If A2=3 then B2=322...If A1=
then B1=560.

In other words, I post a number in A, then go search G for the sam
number, then post the corresponding H value into B.

I've tried the syntax every way but the right way, I guess.


Thanks,
Garr
 
S

skaggsj

It sounds like you could use a vlookup.

In cell b1, input this formula and copy it down to the end of your
input list:
=vlookup(a1,$G$1:$H$5,2,FALSE)

Hopefully, I understood your question correctly.

Jason
 
R

Roger Govier

Hi Garry
There are various ways to solve this problem.
If there are only to be 5 values then in B1
=CHOOSE(A1,100,133,322,440,560)
is probably the easiest.

If you wanted to know the syntax of IF statements, then
=IF(A1="","",IF(A1=5,560,IF(A1=4,440,IF(A1=3,322,IF(A1=2,133,100)))))

If there are to be a lot more values, then it would be better to use a
VLOOKUP() function.

Regards

Roger Govier
 
Top