Forum Discussion

RepublicsFury's avatar
RepublicsFury
Copper Contributor
Aug 23, 2020
Solved

Create a formula to fill in data based on cell

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

  • 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.

     

5 Replies

  • 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.

     

Resources