+ Reply to Thread
Results 1 to 4 of 4

Formula to extract cell values depending on other cells

  1. #1
    Registered User
    Join Date
    07-08-2012
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    21

    Formula to extract cell values depending on other cells

    Hi

    I have a list of order lines and need to transfer data to another sheet if the order contain certain items.

    Here's an example of data in the range A1:D8:

    ON Customer Product Price
    1 Customer 1 Phone 500
    1 Customer 1 Headset 30
    1 Customer 1 Charger 20
    2 Customer 1 Headset 30
    3 Customer 2 Phone 500
    3 Customer 2 Headset 30
    4 Customer 3 Charger 20

    If the order (Order Number = ON) contain a phone i need to transfer it to the same range in a new sheet.

    So for my example i should get this data in my new sheet:

    ON Customer Product Price
    1 Customer 1 Phone 500
    1 Customer 1 Headset 30
    1 Customer 1 Charger 20

    3 Customer 2 Phone 500
    3 Customer 2 Headset 30


    Orders 2 and 4 did not fit the criteria and is left out.

    I have been able to transfer other data with a simple IF and let it return "" if my criteria is not met and this works perfectly for the setup I need.
    But since my criteria in this case does not only concern the row but the order as a whole, I'm stumped

    Hope someone can help.

    Thanks

    Gekko

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula to extract cell values depending on other cells

    Add a Helper column (say, E) and insert the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in row 2 and copy down.

    Then, base your copying on that:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copied across and down ... assuming your data is in Sheet3


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-08-2012
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    21

    Re: Formula to extract cell values depending on other cells

    Brilliant.

    I have so many countifs in the workbook already, but never thought of using it like this.

    Thanks a lot

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula to extract cell values depending on other cells

    You're welcome. Thanks for the rep.

+ 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. Extract Values Depending on Multiple Criteria
    By jesito in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-19-2015, 09:20 PM
  2. Replies: 7
    Last Post: 05-07-2015, 07:29 AM
  3. [SOLVED] Formula to add values in cells depending on what text is entered in other cells
    By Kayaness in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-09-2013, 05:31 AM
  4. Replies: 1
    Last Post: 09-04-2012, 05:49 AM
  5. Replies: 2
    Last Post: 01-09-2012, 02:36 PM
  6. Setting a 1 to a cell depending on values of other cells
    By DRkidd22 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-30-2010, 10:42 AM
  7. Replies: 11
    Last Post: 07-26-2008, 05:18 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