+ Reply to Thread
Results 1 to 17 of 17

Help with index and comparison

  1. #1
    Registered User
    Join Date
    02-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    9

    Help with index and comparison

    Hi,

    I think I`m onto something, but I can`t finish it. I been struggeling with this for some hours now.
    I apprechiate help alot.

    Please download the file and check it out.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Help with index and comparison

    Hi Exces*3

    Match() only works on a single column or row. See if the attached gets what you want. I don't know if you type in the AA, BB, CC or it needs to be calculated from the number. Please describe what is given (typed in) and what needs to be formulated.

    Index Match Multiple Columns.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

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

    Re: Help with index and comparison

    From what you've described, I'd try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The second INDEX/MATCH finds the right column to searched for your number, then the first finds your Santa
    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

  4. #4
    Registered User
    Join Date
    02-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    9

    Re: Help with index and comparison

    Hi thank you so much, It dosen`t work very well.

    I`ve uploaded a new file. I think it explains better what I`m trying to do. There are two examples as you can see.

    Thank you for helping me, I`m very grateful.

    Index Match Multiple Columns_v2.xlsx

    Screenshot_excel.JPG

  5. #5
    Forum Contributor
    Join Date
    08-14-2018
    Location
    Hanoi, Vietnam
    MS-Off Ver
    2016
    Posts
    118

    Re: Help with index and comparison

    Try this ARRAY formula
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with index and comparison

    Maybe Try at B6

    =INDEX(E4:E8,MATCH(ROUND(C4,1-MATCH(B4,F3:H3,)),INDEX(F4:H8,,MATCH(B4,F3:H3,)),))
    or
    =INDEX(E:E,MAX(INDEX(ROW(E4:E8)*(MIN(INDEX(ABS(F4:H8-C4),))=ABS(F4:H8-C4)),)))
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-14-2018
    Location
    Hanoi, Vietnam
    MS-Off Ver
    2016
    Posts
    118

    Re: Help with index and comparison

    @Bo_Ry
    I don't think that Round() and Match(,,false) can work together well since round() changes the lookup value while match(,,false) is the exact match.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with index and comparison

    @congnt92 Thanks.
    In most of the case it won't work, but this one work because it round to match lookup array Eg; 15 round to 20 and 150 round to 200

    But still, we better use aproximate match by remove last comma.
    =INDEX(E4:E8,MATCH(ROUND(C4,1-MATCH(B4,F3:H3,)),INDEX(F4:H8,,MATCH(B4,F3:H3,))))

  9. #9
    Registered User
    Join Date
    02-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    9

    Re: Help with index and comparison

    Now I`m so close...
    Check out the new file. Thank you very much, couldent do it without the help from you guys!

    Almost there....xlsx

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with index and comparison

    Maybe

    =INDEX(B:B,MOD(MIN(INDEX(ABS(INDEX(C3:I19,,MATCH(K2,C2:I2,))-L2)*10^6+ROW(B3:B19),)),10^6))

    Santa 6 355 is the closest to 350

  11. #11
    Forum Contributor
    Join Date
    08-14-2018
    Location
    Hanoi, Vietnam
    MS-Off Ver
    2016
    Posts
    118

    Re: Help with index and comparison

    @Bo_Ry
    Yep, it works with sample data (post #1)
    But it's not a "safe" formula.
    =INDEX(E4:E8,MATCH(ROUND(C4,1-MATCH(B4,F3:H3,)),INDEX(F4:H8,,MATCH(B4,F3:H3,)),))
    will not work if G4=10.1
    =INDEX(E:E,MAX(INDEX(ROW(E4:E8)*(MIN(INDEX(ABS(F4:H8-C4),))=ABS(F4:H8-C4)),)))
    will not work if H5=10.05
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    08-14-2018
    Location
    Hanoi, Vietnam
    MS-Off Ver
    2016
    Posts
    118

    Re: Help with index and comparison

    @excel*3
    Try
    Please Login or Register  to view this content.
    @Bo_ry: Mod() return wrong value if L2=350.1

  13. #13
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with index and comparison

    change in red
    =INDEX(B:B,MOD(MIN(INDEX(ABS(INDEX(C3:I19,,MATCH(K2,C2:I2,))-L2)*10^6+ROW(B3:B19),)),10^5))

  14. #14
    Forum Contributor
    Join Date
    08-14-2018
    Location
    Hanoi, Vietnam
    MS-Off Ver
    2016
    Posts
    118

    Re: Help with index and comparison

    Hi Bo_ry
    If so, with L2=350.11 then you must change the red number to 4 (10^4).

  15. #15
    Registered User
    Join Date
    02-26-2018
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    9

    Re: Help with index and comparison

    Hi again guys, thank you so much for helping me. This is clearly a bit difficult for me. I didn`t excpect it to be so difficult. I try to understand what your`re posting here but I`m struggeling to understand it.
    You have no idea how glad I would be if you could download the file attatched, edit the file and then upload it again.
    I know it`s a lot to ask but I`ll try.
    Again thank you very much, have a great day.

    Almost there....xlsx

  16. #16
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with index and comparison

    Copy and paste formula into K4

    =INDEX(B:B,MOD(MIN(INDEX(ABS(INDEX(C3:I19,,MATCH(K2,C2:I2,))-L2)*10^9+ROW(B3:B19),)),10^3))
    Attached Files Attached Files

  17. #17
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,605

    Re: Help with index and comparison

    In L4
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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. Vlookup/Index for a comparison?
    By clutchrider in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-18-2015, 04:09 PM
  2. Replies: 8
    Last Post: 10-14-2015, 11:58 AM
  3. Comparison 1 vs 2,3,4,5,6
    By EXLent in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-27-2014, 11:25 PM
  4. Column comparison using match and index function
    By shraddha5 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 01:11 AM
  5. Comparison
    By ratu4110 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2012, 12:45 PM
  6. [SOLVED] RE: cell color index comparison
    By avinoam.aharoni in forum Excel General
    Replies: 2
    Last Post: 07-06-2005, 02:05 PM
  7. [SOLVED] cell color index comparison
    By MINAL ZUNKE in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-30-2005, 03:05 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