+ Reply to Thread
Results 1 to 7 of 7

Return Min Values Across Several Sheets

  1. #1
    Registered User
    Join Date
    07-27-2015
    Location
    Ohio
    MS-Off Ver
    2010
    Posts
    4

    Return Min Values Across Several Sheets

    Looking for a formula/solution to return lowest pricing options across multiple sheets.

    Sheet = Service Provider Lane Analysis RFQ.xlsx
    Columns = Airport location and shipment pricing rates
    Rows = Product purchased

    I would like to have a table generated on a separate sheet that will allow me to look at all pricing data (excluding $0), and list the lowest price and service provider for each product model shipping to the specific airport. See attached for example. End result will have 7 sheets total.

    Thank you for any help you can provide!

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return Min Values Across Several Sheets

    I came up with two solves for this.

    The first uses a 3-D CountIf. Somewhere make a list of the sheet names and then name that range. I called mine Sheets, which refers to the words Schenker and MTA.

    =SMALL(INDIRECT("'" &Sheets&"'!" & SUBSTITUTE(ADDRESS(1,COLUMN(F3),4),1,"") & ROW(A3)),
    COUNTIF(INDIRECT("'" &Sheets&"'!" & SUBSTITUTE(ADDRESS(1,COLUMN(F3),4),1,"") & ROW(A3)),0)+1)


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Then just copy over and down as needed.

    Or, you could just VBA which would be considerably less burdensome on your processor. (The former solution uses lots of INDIRECT!)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by daffodil11; 07-27-2015 at 04:12 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    07-27-2015
    Location
    Ohio
    MS-Off Ver
    2010
    Posts
    4

    Re: Return Min Values Across Several Sheets

    Hello!

    Thank you for responding! Is there a solution that would provide the name of the sheet, therefore, we would know who has the lowest rate? Eg. On the "Analysis" sheet we (B2) that cell would state "Schenker" because it was the lowest rate?

    Thanks again for the help!

  4. #4
    Registered User
    Join Date
    07-27-2015
    Location
    Ohio
    MS-Off Ver
    2010
    Posts
    4

    Re: Return Min Values Across Several Sheets

    I also found that the data did not calculate correctly, as the rows did not line up on all sheets. There is an additional row in sheets (Schenker and MTA)

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return Min Values Across Several Sheets

    The code accounts for the difference in your data formatting, which is why the formula references begin on row 3, and the procedure begins on r + 1.

    Here is the revised code, which outputs the sheet names.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-27-2015
    Location
    Ohio
    MS-Off Ver
    2010
    Posts
    4

    Re: Return Min Values Across Several Sheets

    Excellent! I am not very familiar with Macros so I apologize if these questions are simple answers. Could you please let me know which areas I would need to modify if I add additional sheets of data? I clearly would need to redefine my range list but within the Macros is there anything else required? Thanks again

  7. #7
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return Min Values Across Several Sheets

    Nothing would really need to be changed. The code is skipping any sheet named Analysis when it does its comparison. If you want to skip other sheets you could list them as well, otherwise all other sheets will be included.

    The only other thing to keep in mind are the ranges and how it matches up. This code runs from on Analysis, from Cell coordinates 2,2 to Cell Coordinates 17,30. On the other sheets, this cell reference lines up with r +1, c + 4 since the other sheets are slightly misaligned to Analysis. For the first cell 2,2 this matches up to (2+1,3+4) = (3, 7) = F3.

    Please Login or Register  to view this content.

+ 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. Macro that searches column B in all sheets for all the different values and return in list
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2014, 02:43 PM
  2. Replies: 3
    Last Post: 06-25-2014, 02:40 PM
  3. Replies: 3
    Last Post: 01-14-2014, 11:59 AM
  4. [SOLVED] Return multiple rows based on values in other sheets
    By DutchYankee in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2013, 09:43 AM
  5. Replies: 1
    Last Post: 10-28-2011, 03:13 AM
  6. Vlookup 2 sheets and return values in rows
    By fun4four in forum Excel General
    Replies: 3
    Last Post: 11-04-2010, 04:37 PM
  7. How to return values from different sheets
    By SMB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2009, 02:56 PM

Tags for this Thread

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