IF function

Hi !!

My IF function never works so I need some help :)

I have a spreadsheet with columns for Item description (column B) and Item No.(column B) I'd like to populate the Item No automatically maybe using IF function, for example:

IF "B1" = ball then "A1" = 1000, IF "B1" = pen then "A1" = 2000, IF "B1" = bottle then "A1" = 3000

How should I do it ??

Thank you.

Almir's picture

IF function

You may also create another table with ball, pen etc. in one column and number values in another. Then use VLOOKUP function to get appropriate numbers in A column. This is easier if you get some new words. In such case you just add that word to lookup table, instead of changing the IF formula.

Nick's picture

there's one case you

there's one case you missed... if it equals something else.

Here's a function that does what u want, and returns "ERROR" if it equals something else.

=IF(B1="ball",1000,IF(B1="pen",2000,IF(B1="bottle",3000,"ERROR")))