+ Reply to Thread
Results 1 to 8 of 8

I want to fill multiple cells based on the result in one cell

  1. #1
    Registered User
    Join Date
    05-31-2014
    Posts
    3

    I want to fill multiple cells based on the result in one cell

    So here's what I want to do...

    When I enter barcode X in cell A1, I want B1 to say supplier and C1 to say product name and D1 to say package quantaty etc.

    And if I enter barcode Y in cell A2, I want B2 to say different supplier, and so on, hopefully you get the picture.

    Any ideas?

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: I want to fill multiple cells based on the result in one cell

    Hi,

    Welcome to the Forum.

    Can you upload a workbook with sample data?

    Kindly do not upload a picture of your file... Rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome (manually entered is ok) and how you arrived at that. (Exclude sensitive info). Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you. Also, not all members can upload picture files (Company firewalls, etc.)

    To attach a file to your post, click advanced (next to quick post), scroll down until you see "manage file", click that and select "add files" (top right corner).
    Click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window. You can then close the window to return to the new post screen.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  3. #3
    Registered User
    Join Date
    05-31-2014
    Posts
    3

    Re: I want to fill multiple cells based on the result in one cell

    Essentially, what I'm trying to accomplish is a purchase history. There will be a very limited number of different UPCs and the same items will be purchased many times. Having a second sheet as a data source would not be a problem.

    I will not be tracking amounts on hand or when things leave, this is not to serve as an inventory, otherwise I would imagine that sort of software already exists.

    Example spreadsheet attached. Random household products added for illustration.
    Attached Files Attached Files
    Last edited by crashwg; 06-02-2014 at 08:48 PM.

  4. #4
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: I want to fill multiple cells based on the result in one cell

    Does using VLOOKUP for each Product, Maker and Contents fulfill your need?

    In Sheet1, For Product, use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    For Maker, use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    For Contents, use
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: I want to fill multiple cells based on the result in one cell

    Try this......
    On sheet1,
    In B2
    Please Login or Register  to view this content.
    and then drag across to D2 and down until you get blank cells.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  6. #6
    Registered User
    Join Date
    05-31-2014
    Posts
    3

    Re: I want to fill multiple cells based on the result in one cell

    Bingo for Saarang84. I was able to adapt what I learned into my final spreadsheet by researching the VLOOKUP function and its parameters.

    The only issue I ran into (if you can even call it one) is if it found a blank cell, it would return a zero. I used custom formatting for the column of
    Please Login or Register  to view this content.
    to clear that up though. Bonus points to anyone who can incorporate a blank cell workaround into the formula!

    I tried sktneer's formula as well, and while it seems to work fine in the file he uploaded, I have been unsuccessful in implementing it on my own as of yet. I will continue to try and make it work as I believe, why use 5 formulas when 1 will do.


    Alright, it's honesty time. I didn't read the forum guidelines, nor do I plan to, so please advise as to what the norm is around here regarding reputation. I added rep to Saarang84, since his response was first and solved my question. While I haven't quite figured out skteer's formula, he's shown that it does in fact work and it's cleaner than Saarang84's.

    So do I add rep to multiple people who solve the same problem?

  7. #7
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: I want to fill multiple cells based on the result in one cell

    Quote Originally Posted by crashwg View Post
    So do I add rep to multiple people who solve the same problem?
    There is no hard and fast rule for adding reps here in this forum.. Its just a way of showing your appreciation to those who are posting solutions...

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: I want to fill multiple cells based on the result in one cell

    Look at the formula suggested in the post#5 like this......

    When you place the formula in B2, IFERROR(INDEX(Sheet2!B$2:B$4,MATCH($A2,Sheet2!$A$2:$A$4,0)),"") returns the matching value from the col. B of sheet2 and while you drag the same formula across to C2 the same formula becomes IFERROR(INDEX(Sheet2!C$2:C$4,MATCH($A2,Sheet2!$A$2:$A$4,0)),""), it returns the matching value from col. C of sheet2 and while you further drag that formula to D2, the formula becomes IFERROR(INDEX(Sheet2!D$2:D$4,MATCH($A2,Sheet2!$A$2:$A$4,0)),"") and thus returns the matching value from col. D of sheet2. Note that the Match portion of the formula remains the same whether you drag the formula across or down since it is using the absolute cell reference. But in the Index portion of the formula [INDEX(Sheet2!B$2:B$4,], the row reference is locked but it is using the relative column reference. So when you drag the formula from B2 to C2, the Index portion changes to [INDEX(Sheet2!C$2:C$4] and so on.
    Therefore only one formula can return the matching values from all the three columns. B, C and D of sheet2.
    I hope that this will help you to implement the formula in your original workbook. The thumb rule for this formula to work is, all the target columns of sheet2 should be adjacent to each other. (Like Col. B, C and D). And if you are trying to return first value from say col. B and second value from col. D and third value from col. F, this formula will not work because the Col. B, D and F are not adjacent to each other.

+ 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. Fill a column based on multiple cells
    By keeblerelf in forum Excel General
    Replies: 10
    Last Post: 04-13-2014, 03:32 AM
  2. [SOLVED] Format Cell fill based on contents of multiple other cells
    By nsmjc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2013, 03:07 AM
  3. Adding multiple cells based on the result of a data validation cell
    By ronrona96 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-20-2013, 12:19 AM
  4. Result cell based on multiple IF statements
    By Tino XXL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-24-2011, 02:30 AM
  5. Replies: 6
    Last Post: 08-11-2006, 05:50 PM

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