+ Reply to Thread
Results 1 to 18 of 18

Index and match with several criteria!!Help

  1. #1
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Index and match with several criteria!!Help

    Hi

    Im not very well use in the use of index and match but for the function i need to do this is the only possible way of doing it with out going into visual basic.

    I currently have a table of different configuration, (Draft table) table been sorted by V column largest first


    draft table.PNG


    Currently im using severely fields that will be used to select the correct line (these criteria values change depending on other calculations)


    critera.PNG

    Currently I have had to use two extra fields to help me (current trip and Rated frame size)

    current trip.PNG


    frame size.PNG

    Currently the frame size is looking up the trip current column as that's the one been sorted.

    I would like to be able to get rid of these extra fields and just go off the original values (running current and rated amps) and also know how to add additional criteria like Voltage and kA

    Here is my current Formula

    Please Login or Register  to view this content.
    This is currently give me a value of 82. As you can see i want to know add the voltage any device that has a higher number and also the kA rating any device that is higher

    If the current values are use this should give me an answer of 91 (column L)

    For the life of me i can seem to this to work and im running out of ideas. Please help

    Also the table i would like to be able to add data to it would having to do any sorting, if its possible.

    Regards

    Daniel
    Last edited by l3lackdrake; 07-08-2017 at 07:07 PM.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Hi l3lackdrake, welcome to Excel Forum! A small sample workbook would really help us to solve your problem quickly and accurately.
    Remove any sensitive or extraneous info, just give us some data (with headers please) to test. Nobody's going to manually copy it from a picture.
    Also, please simulate some results so we know what they look like and where they go.

    To attach a workbook:
    Click Edit Post (or just start a new reply.)
    Click Go Advanced
    Scroll down to Manage Attachments and click.
    Now just Browse for your file, then click Upload. Simple!
    Last edited by leelnich; 07-08-2017 at 07:51 PM.

  3. #3
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi leelnich

    Thanks for getting back to me on this. Currently this workbook is in the beginning so i can shear the it with you.

    Please find attached the Workbook, Please not there will be severely spelling errors due to my dyslexia.

    thanks in advance

    Daniel
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,204

    Re: Index and match with several criteria!!Help

    I don't understand how you get a result of 91: what parameters are you using to derive this value?

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Try this. Development steps are shown below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Untitled.png

    The final step is a bit of a hack. I couldn't be certain that the same range of voltages is available to all configurations, so I used the other conditions in a IF() statement to define a configuration, then used MATCH on the appropriate subset. The Voltage look-up column is a secondary descending sort key, so an APPROXIMATE match can be found.

    If desired, you could use a separate table or formula to establish the exact voltage and avoid this inconsistent treatment of criteria.
    Hope this helps-Lee

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 07-09-2017 at 12:09 PM.

  6. #6
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi Leelnich

    thanks for going over this for me.

    I had a look over the formula and i adjusted a bit for the voltage and some other little tweeks

    PHP Code: 
    =INDEX('Brackers&Fuses'!L3:L102,MATCH(1,(INDEX('Brackers&Fuses'!U3:U102,MATCH(E43,'Brackers&Fuses'!V3:V102,-1))='Brackers&Fuses'!U3:U102)*(INDEX('Brackers&Fuses'!V3:V102,MATCH(E41,'Brackers&Fuses'!V3:V102,-1))='Brackers&Fuses'!V3:V102)*(E40='Brackers&Fuses'!S3:S102)*(INDEX('Brackers&Fuses'!W3:W102,MATCH(E38,'Brackers&Fuses'!W3:W102,-1))='Brackers&Fuses'!W3:W102)*(INDEX('Brackers&Fuses'!T3:T102,MATCH(E39,'Brackers&Fuses'!T3:T102,-1))='Brackers&Fuses'!T3:T102),0)) 
    this works for the most part, when i started to put in a higher kA rating like 25 this should select the fuse line as it set to 1000 for the voltage, frame size, tip and kA but instead i get a N/A so it not finding it.

    I also then tried sorting the table by the name and now the formula dose not work at all.

    Is there a away to have the table in a no sort envelopment as this will be added to by others and if noting cant be found it returns the answers as fuse?

    Thanks for your help so far

    Regards

    Daniel

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Hi l3lackdrake. This would do that, and is also sort-proof:
    Untitled.png

    However, I recommend thorough testing before adding the IFERROR clause, as it hides all manner of sins and can really hamper debugging.

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


    NOTE: This is a very long formula. I had a few problems with copy/paste. If Excel TRUNCATES it when you paste, try this work-around:
    Temporarily re-name the Brackers&Fuses sheet xx. Now paste the following, and then change it back.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 07-12-2017 at 07:02 AM.

  8. #8
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi Leelnich

    Thanks for putting this across. I have got the formula and renamed the sheet to xx. Ill do some debugging so it can select the correct component.

    Currently for your information i have the following inputs:

    input.PNG

    With this i get the following results: Top one with the iferror

    result.PNG

    As you can see this should be bringing line 21. see picture of the table line.

    data line.PNG
    I will thought using a different cell that will show the result and if its 1 then use the word "fuse" will be displayed so that way is not all in one cell.

    Like i said i will try and do some debugging to see how its looking up.

    I will say thank you so far for your help with this.

    Regards

    Daniel
    Last edited by l3lackdrake; 07-12-2017 at 05:53 PM.

  9. #9
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    With those criteria, I'm getting the correct answer - part #66 (different row because different sort order). Have you altered the formula?

    See attached workbook.

    ps Why is your Frame Size 500? The formula calculates 250 - the smallest working value.
    Attached Files Attached Files
    Last edited by leelnich; 07-12-2017 at 09:19 PM.

  10. #10
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi Leelnich

    Thank for sorting that out. I tested out the formula with multiple entries and it all work great.

    I Then added two more devices at the bottom of the table, first i added the 160 frame size and it work fine then i added the 500 frame size and this is were it stopped and errored.

    The table i have shifted everything down so that line 1 is empty which i can use as the fuse.

    as soon as i did that it now bring in 1 where it should bring in 13

    7.PNG

    8.PNG

    Not sure on the limitation of the formula but would splitting up the frame sizes on different sheets help?

    Regards

    Daniel

  11. #11
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Hi Daniel- With your new configurations, the frame size and current trip calculations for these criteria aren't compatible.
    Frame size (Amps =168) finds 250 in column U (several rows, but not row99).
    Current Trip (R.Cur.=135) finds 140 in column V (row99 only one). So MATCH fails.

    I'm not an engineer, so I don't really grasp the principles underlying these specs. You need to decide how to proceed.

    Ps. Rather than graphics, upload latest workbook. Saves time for both of us.
    Last edited by leelnich; 07-13-2017 at 08:55 AM.

  12. #12
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi leelnich

    Thanks for pointing out what it doing any why its not matching up.

    Ideally it needs to check the frame size which would be 250 and then check the current trip size 135 look for the next size up in the 250 frame size. if there is no trip then look at the next frame size and recheck current trip size. once a match is found check kA, voltage and phase.

    Also note that the lower voltage can be used on a higher unit voltage if it fall with in the kA rating.

    I hope this helps a little . Please let me know if its possible to do this either in one cell or using multiply cells. If not then ill will have to re look at my table and my be go down the root of VB coding.

    Thanks again for your help..

    Regards

    Daniel

  13. #13
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Daniel-
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    1) Changed Order of Calculation to match columns on Sheet xx ('Brackers&Fuses').
    Phase, Voltage, Frame Size & Current Trip, kA Rating RMS

    2) Changed method of determining minimums- shorter + more flexible
    (SMALL(xx!T3:T102,COUNTIF(xx!T3:T102,"<"&E39)+1)=xx!T3:T102) became (MIN(IF(xx!T3:T102>=E39,xx!T3:T102))=xx!T3:T102)

    3) Merged tests for Frame Size & Current Trip.
    (MIN(IF((xx!U3:U102>=E43)*(xx!V3:V102>=E41),xx!U3:U102+xx!V3:V102/65536))=xx!U3:U102+xx!V3:V102/65536)

    This adds a fraction of CTrip to Frame Rating for all rows that meet BOTH criteria, then keeps those that contain the MIN of that array.
    The value 65536 was chosen as a divisor because a) it's bigger than any likely Current and b) computers like binary numbers. (2^16)

    Also:
    Quote Originally Posted by l3lackdrake View Post
    Also note that the lower voltage can be used on a higher unit voltage if it fall with in the kA rating.
    I'm not sure what you mean by this. The formula is supposed to return a SINGLE result based on minimum compatible values, correct?
    Last edited by leelnich; 07-13-2017 at 06:48 PM.

  14. #14
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi leelnich

    I will have a look at this over the weekend.. got a wedding today ^^..

    For the voltage device are designed for voltage insulation so a lower voltage can be used on a higher device within the operation limits this means a 470 can work on the 480 and 690.. only reason it would use a 690 volt bracker is if had a useable kA rating..

    Hope that help explain that..😞

    Regards

    Daniel

  15. #15
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Hey Daniel, hope the wedding was fun! Best wishes to the... and all that.

    After reflecting on Post #12, I decided to concatenate all numeric values (in order of priority) to yield a single numeric "key" for each row. Then one MIN(IF structure yields the SMALLEST key that meets ALL of the corresponding criteria. This, in conjunction with the remaining criteria (Phase as text), represents the optimal solution.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Building the keys entailed formatting each number as text to ensure correct alignment/order. This makes the formula pretty long, but it's actually simpler.
    NOTE: While developing this approach, I employed a helper column (xx!M3:M102) to make the keys. The final version doesn't use it, but I left it in the attached workbook so you could see how they work. The "helped" version of the formula - considerably shorter - is also present.
    I hope you find this of some use. Happy motoring...-Lee
    Attached Files Attached Files
    Last edited by leelnich; 07-15-2017 at 12:22 AM.

  16. #16
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi Leelnich

    Thanks for all your help. This is an absolute master piece. Which once i grasp and understand it on a fundamental level ill be able to use on several other application.

    I am tho having a little trouble, if i do any changes to the formula even if its to increase the cell range like 103 to 250 is stops working. im using the shift + control + enter but still no luck is there something im missing?

    Thanks

    Daniel

  17. #17
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index and match with several criteria!!Help

    Daniel- Doing it piecemeal like this is just frustrating us both. There's too many moving parts. Let's do this. On Sheet(xx), add all the possible permutations you're going to want to test (as new rows). Then attach a copy of that workbook to a post as you did before. That gives us a STABLE TESTBED. Now when you change the formula and it doesn't work, you can just post a copy of the failed FORMULA, along with parameters, so I can follow what you did. I've enjoyed this challenge, but let's be systematic and finish this. Thanks - Lee

  18. #18
    Registered User
    Join Date
    07-08-2017
    Location
    norwich
    MS-Off Ver
    2007
    Posts
    9

    Re: Index and match with several criteria!!Help

    Hi Lee

    Sorry for all the back forth between us. I will fill this in as much as I can once im at work and write done the process of it..

    Like I said this was a working progresses and this step is the first of many which is why I want to get a grip of how it works so I can apply it later on as well.

    Again I would like to thank you for your help up till now.

    Regards

    Daniel

+ 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. Single Criteria Index Match with concatenated criteria NOT WORKING
    By hassanleo1987 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 04-26-2017, 12:28 AM
  2. Need help in Index, Match usage to match multiple criteria in sum function
    By Summer0830 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2017, 02:47 AM
  3. VBA Code for Index/Match/Match to input into excel based on 2 criteria inside form
    By Carl Fisher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2017, 12:11 PM
  4. [SOLVED] Index and Two Match Criteria- meeting both criteria (need help to repair formula)
    By OilAndGasMan1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2017, 10:56 PM
  5. [SOLVED] Combining 3 Formulas: Return all Names that Match Criteria Using Index/Match
    By bchilme in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-29-2014, 09:28 AM
  6. Replies: 2
    Last Post: 09-27-2014, 04:34 PM
  7. Replies: 6
    Last Post: 04-30-2014, 02:42 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