+ Reply to Thread
Results 1 to 6 of 6

Using a formula to populate a cell with certain data based on content of another cell

  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    Sheffield, England
    MS-Off Ver
    2007
    Posts
    3

    Using a formula to populate a cell with certain data based on content of another cell

    Hi.

    I am currently trying to create a spreadsheet whereby if I enter certain text in a cell in Column A on worksheet 1 that correlates with text in a cell in Column A on Worksheet 2, then the description in Column B in Worksheet 2 is entered into Column B on worksheet 1. Does that make sense?

    For example, if worksheet 2 has the following:

    Column A Column B
    XXXX PRODUCT 1
    YYYY PRODUCT 2

    and I enter XXXX in column A on worksheet 1, I want Column B on worksheet 1 to automatically enter PRODUCT 1.

    Can anyone tell me the right formula? I have tried searching for it but I am having no joy.

    Thanks in advance for any help.

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Using a formula to populate a cell with certain data based on content of another cell

    I would use an IF formula. The syntax is:

    =IF(logical_test,value_if_true,value_if_false)

    so for your application you would need two of them,

    =IF(A1="XXXX","PRODUCT 1",IF(A1="YYYY,"PRODUCT 2","")

    Edit between the quotes and you should be good to go

    If there are more than two products, your IF's will start getting confusing. It would be best to use a VLOOKUP instead. How many possible variations are there?
    Last edited by Speshul; 07-07-2014 at 11:03 AM.

  3. #3
    Registered User
    Join Date
    07-07-2014
    Location
    Sheffield, England
    MS-Off Ver
    2007
    Posts
    3

    Re: Using a formula to populate a cell with certain data based on content of another cell

    Thanks for the quick reply. the only problem I have is that I have a range of 400 codes and their corresponding descriptions so I need to apply a range to the formula. I have been experimenting with the IF function but with no joy as yet.

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Using a formula to populate a cell with certain data based on content of another cell

    If you have a table of these 400 codes, you should use a vlookup. I have attached an example of how they work, let me know if this will work for you.

    The formula is in the Yellow cell, the value it is looking for is in B1. Type in B1 VVVV,WWWW,XXXX,YYYY or ZZZZ and cell A1 will change to match it's corresponding product number based on the green table.

    Typo in the notes on this file, the 2 in the fomula is col_index_number, not lookup_table!
    Attached Files Attached Files

  5. #5
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Using a formula to populate a cell with certain data based on content of another cell

    Use this formula ...
    Drag it down...
    Change it upto your needs
    =vlookup(A1,worksheet2!$A$1:$B$400,2,False)

    say thanks click *
    Last edited by Vikas_Gautam; 07-07-2014 at 11:18 AM.

  6. #6
    Registered User
    Join Date
    07-07-2014
    Location
    Sheffield, England
    MS-Off Ver
    2007
    Posts
    3

    Re: Using a formula to populate a cell with certain data based on content of another cell

    Thanks so much for your help guys. that has done exactly what I was wanting it to do.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-19-2014, 04:20 PM
  2. conditionally enter data in a cell based on content of another cell
    By jrustebakke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2014, 02:47 PM
  3. Formula to populate cell based on data input elsewhere
    By Unca Wook in forum Excel General
    Replies: 1
    Last Post: 11-03-2010, 07:05 PM
  4. Replies: 2
    Last Post: 12-19-2006, 10:50 PM
  5. [SOLVED] Cell Formula reference to cell Based On third Cell Content
    By Gabriel in forum Excel General
    Replies: 0
    Last Post: 02-11-2005, 02:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1