+ Reply to Thread
Results 1 to 2 of 2

Look up based on a "type" and also a value within a target range

  1. #1
    Registered User
    Join Date
    11-11-2022
    Location
    USA
    MS-Off Ver
    Microsoft 365 MSO (Version 2202 Build 16.0.14931.20806) 64-bit
    Posts
    1

    Look up based on a "type" and also a value within a target range

    Hi!

    I'm trying to make this formula using index and match but I have a missing part. Here's what I'm trying to get:

    I have 2 columns on my sheet 1: Type and Size. Type contains values like: Gate, Butterfly.. etc (Valves type)
    Size is just a number

    On my sheet 2 I have the columns Classification, Type and Minimum and maximum sizes.

    My problem is, in the sheet 1 I need to get the right classification from sheet 2 based on the type and the size, which will be a value between the minimun and maxmiun from sheet 2 but always taking in consideration the type.

    Right now I have this formula but of course is not choosing the right row:

    =INDEX($E$30:$H$65,MATCH(B168,$E$29:$E$65,0),4)
    =INDEX(TablerangeInSheet2,Match(TypeFromSheet1,$TypeColumnInSheet2,0),TheColumnIWantToGet)

    Please let me know any question you have and I'll try to clarify the best I can.

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #1 requires good titles. "Help with a formula" does not tell us about your question. I have updated it for you this time because you are a new member. --6StringJazzer
    Attached Images Attached Images
    Last edited by 6StringJazzer; 11-11-2022 at 12:01 PM. Reason: better titles please

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Look up based on a "type" and also a value within a target range

    Assuming that the rows in sheet two are all unique, we can use SUMPRODUCT to add up all the Row values that match the options you need. So if there are multiple matches it will return something you don't expect, because it will be adding up multiple Rows, but if they're unique it will be adding up only one value (hopefully, the correct one).

    Anyway something like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    As an aside, in your shoes I would probably clean up the min and max values to be more real, like make VLV-BFV-S go from 2 to 4.5, and then test "min<=size" instead of "min<size" for example, while VLV-BFL-M goes from 5 to 7. This means that if someone puts in a 4 3/4" valve it would throw an error code as being unspecified, but like, yeah nobody sells that so it's still good information. Likewise VLV-BFV-XXXL will probably top out at 36 or 48 instead of, as shown here, 16 miles across.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

+ 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: 3
    Last Post: 03-24-2020, 07:27 AM
  2. Replies: 3
    Last Post: 01-10-2019, 09:34 AM
  3. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  4. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  5. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  6. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  7. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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