+ Reply to Thread
Results 1 to 9 of 9

auto pick up info from different sheets by conditions

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    auto pick up info from different sheets by conditions

    hi,
    could anyone help me with the below query?

    I'll need to pick up the rates from sheets "SYD" & "BNE" by info from column A of "Summary", which means if the info in column A is "sydney", the formula should pick up the rates from sheet "SYD", if it's "brisbane", the formula should pick up the rates from sheet "BNE".
    Also, the rate should be matched by the column B,C & D from "summary" page.

    Thanks,
    M
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: auto pick up info from different sheets by conditions

    I always always caution people against putting on two sheets for reference what should and can be on one sheet for reference. Copy the data from the Brisbane sheet onto the Sydney sheet below the Sydney data and you have one perfect table that can grow as long as it needs to and is easy to maintain. Rename that sheet "Rates".

    For the PerKg table, only list the START of each tier in E3:G3, so that would be 0, 500, 1000.

    Then the formulas would be:

    E2: =VLOOKUP($C2, Rates!$A:$D, 4, 0)
    F2: =INDEX(Rates!$E$4:$G$12, MATCH($C2, Rates!$A$4:$A$12, 0), MATCH($D2, Rates!$E$3:$G$3, 1)) * $D2
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: auto pick up info from different sheets by conditions

    Quote Originally Posted by JBeaucaire View Post
    I always always caution people against putting on two sheets for reference what should and can be on one sheet for reference. Copy the data from the Brisbane sheet onto the Sydney sheet below the Sydney data and you have one perfect table that can grow as long as it needs to and is easy to maintain. Rename that sheet "Rates".

    For the PerKg table, only list the START of each tier in E3:G3, so that would be 0, 500, 1000.

    Then the formulas would be:

    E2: =VLOOKUP($C2, Rates!$A:$D, 4, 0)
    F2: =INDEX(Rates!$E$4:$G$12, MATCH($C2, Rates!$A$4:$A$12, 0), MATCH($D2, Rates!$E$3:$G$3, 1)) * $D2
    Thank you so much for the help!
    An issue with the formula,the row match "MATCH($C3, Rates!$A$4:$A$12, 0)" should match by both column B&C, which is Destination Suburb +Post code, would you be able to get the worked?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,738

    Re: auto pick up info from different sheets by conditions

    I got interrupted by lunch, but here's an alternative. You need to change the values in E3:G3 of the SYD and BNE sheets to 0, 500, 1000, as Jerry advised, then you can have this formula in E2 of the Summary sheet:

    =INDEX(INDIRECT("'"&IF(A2="Sydney","SYD","BNE")&"'!E:G"),MATCH(C2,INDIRECT("'"&IF(A2="Sydney","SYD","BNE")&"'!A:A")),MATCH(D2,INDIRECT("'"&IF(A2="Sydney","SYD","BNE")&"'!E3:G3")))

    and then copy this down.

    Not sure why you need to match on postcode and Suburb - isn't the postcode fairly unique?

    Hope this helps.

    Pete

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: auto pick up info from different sheets by conditions

    Here's a solution for 2 sheets. It becomes much easier if you follow JB's advice and move all tables to a single sheet.
    I inserted a column A into your tables which you can hide later
    =C4&B4
    For fixed cost
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    for adjustable cost
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: auto pick up info from different sheets by conditions

    Quote Originally Posted by ripple View Post
    Thank you so much for the help!
    An issue with the formula,the row match "MATCH($C3, Rates!$A$4:$A$12, 0)" should match by both column B&C, which is Destination Suburb +Post code, would you be able to get the worked?
    Well, I know you could "invent" data that showed this need, but does your real data actually have that need? I've never seen a postal chart (and I've made many) that needed anything other than the zip code to determine the rate. You have "zip codes" that have multiple rates within that one zip?

    I believe in simple. Look at the INDIRECT() formulas required to keep the separate sheets, compared to the ones used on the merged sheet I suggested? We can continue to make formulas more and more complicated, but only if 100% necessary. Is it? Really? Check your real data.

  7. #7
    Registered User
    Join Date
    10-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: auto pick up info from different sheets by conditions

    thanks pete, the formula is working

  8. #8
    Registered User
    Join Date
    10-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: auto pick up info from different sheets by conditions

    thkanks,ChemistB, it works

  9. #9
    Registered User
    Join Date
    10-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: auto pick up info from different sheets by conditions

    With the source data, the same post code could have several different suburbs, but seems all are at the same rate.
    So for the time being, i will leave it as it is. Thanks



    Quote Originally Posted by JBeaucaire View Post
    Well, I know you could "invent" data that showed this need, but does your real data actually have that need? I've never seen a postal chart (and I've made many) that needed anything other than the zip code to determine the rate. You have "zip codes" that have multiple rates within that one zip?

    I believe in simple. Look at the INDIRECT() formulas required to keep the separate sheets, compared to the ones used on the merged sheet I suggested? We can continue to make formulas more and more complicated, but only if 100% necessary. Is it? Really? Check your real data.

+ 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: 4
    Last Post: 10-02-2013, 03:00 PM
  2. Macro to Pick Info from Each Sheet
    By smmeader in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2012, 10:49 AM
  3. Auto Populating Rows on Separate Sheets with Conditions
    By johnsond1021 in forum Excel General
    Replies: 1
    Last Post: 11-17-2011, 01:58 AM
  4. Random pick (multi column) info for audit
    By sjmgeezer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2007, 05:57 AM
  5. Auto Update Info from Different Sheets?
    By silencebreaking in forum Excel General
    Replies: 3
    Last Post: 06-12-2006, 10:50 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