"if" , "then" formulas

G

Guest

I would like to format my spreadsheet so that when I enter a word in one cell
it automatically inputs a value in another cell. For example: (if cell
A1="Blue Shirt" then cell B1=4.39, if cell A1="Red Shirt" then cell B1=5.19)
....and so on. This way Excel can automatically tally the cost of the item I'm
putting in and give me that value in the adjasent cell. I've seen it done, I
just can't remember how. Help!
 
G

Guest

You should set up a table, e.g. items in Y1:Y10 and corresponding costs in
Z1:Z10
then use this formula in B1

=VLOOKUP(A1,$Y$1:$Z$10,2,0)
 
B

Bob Phillips

=LOOKUP(A1,{"Blue Shirt","Red Shirt"},{4.39,5.19})

which can easily be extended by adding to the two arrays.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Guest

That would work if I were searching for these values, right? But I'm creating
a list...a very LONG list...and I want to be able to shorten my work load by
having excel automatically enter in a cost for each item as soon as I'm typed
it in. e.g. I type "Blue Shirt" in cell A1 (and cell A1 has some nifty
formula that recognizes the words "Blue Shirt") and Excel automatically puts
in a value of $4.39 in cell B1. I've even seen Excel create a drag-down list
in the cell that tells me what my options are (e.g. "Blue Shirt", "Red
Shirt", "Green Shirt") based on the formula specs. That's kind of what I ment
by "if" , "then". Does that expain it a little better?
 

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