SOLVED

Create a formula to fill in data based on cell

Copper Contributor

I would like to create a formula that fills in Cell (column) BX based upon the input in cell AX.

 

A1: Cow

A2: Chicken

A3: Pig

 

B1: $400.00

B2: $5.00

B3: $50.00

 

So my thoughts are something like B1: =IF(A1=Cow,$400.00,(A1=Chicken,$5.00,(A1=Pig,"$50.00))) 

 

But that formula doesn't work. Is there a place I can look up formulas to try to assemble a formula like what I'm looking for? I searched for formulas and it seems like it will have to be some type of VB but I don't know VB so... any help would be appreciated.

 

What I want to do is type something (i.e. Cow, Pig, Chicken) in column A and then B returns a dollar value based upon the text I've entered in column A. BUT only for Rows 21 - 50 (or whatever).

 

Regards,

 

RF

5 Replies
best response confirmed by RepublicsFury (Copper Contributor)
Solution

@RepublicsFury 

 

The formula should be like this...

 

=IF(A1="Cow",400,IF(A1="Chicken",5,IF(A1="Pig",50,"")))

 

But I would suggest that instead of hard coding the item and it's price in the above formula, you should create a price list somewhere in the file and then you can use VLookup formula to get the priced of the item you input in column B.

 

The attached has two sheets which show both the methods.

 

@RepublicsFury 

You're welcome! Did that resolve your issue? If yes, please take a minute to accept the post with the proposed solution as a Best Response in order to mark your question as Solved.

@Subodh_Tiwari_sktneer 

 

New at the posting and accepting... .thanks for the help.

 

I think I did it right and accepted that as the right response. It did solve the issue. I'll create the Price List on a Worksheet and then use that as the reference for the formula on each other Worksheet inside the Workbook.

 

Thanks again!

 

- RF

@RepublicsFury 

Thanks! You correctly marked the proposed solution as a Best Response.

 

Stay safe and healthy

Have a nice weekend!

1 best response

Accepted Solutions
best response confirmed by RepublicsFury (Copper Contributor)
Solution

@RepublicsFury 

 

The formula should be like this...

 

=IF(A1="Cow",400,IF(A1="Chicken",5,IF(A1="Pig",50,"")))

 

But I would suggest that instead of hard coding the item and it's price in the above formula, you should create a price list somewhere in the file and then you can use VLookup formula to get the priced of the item you input in column B.

 

The attached has two sheets which show both the methods.

 

View solution in original post