+ Reply to Thread
Results 1 to 7 of 7

Index/Match fails when the Match Criteria is determined by a formula result

  1. #1
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Index/Match fails when the Match Criteria is determined by a formula result

    Hi All,

    With some great help from By_Ro, he created a formula for me which determines the nearest time value based on three text input criteria.

    Once the nearest value is found, I then need to determine another value using the Offset function for the cell address of the found nearest value.

    The issue I am having is that finding the cell address using the result of a formula seems to be a no no.

    My formula is: =CELL("address", INDEX($I$5:$I207,MATCH(1,($N$8=$I$5:$I207)*($P$8=$K$5:$K207)*($N$12=$L9:L204),0),1)) - please see attached sheet.

    The troublesome parts is this guy ($N$12=$L9:L204) because $N$12 is a formula result. If I keyed the same value from the keyboard, no problem, it works.

    So I am asking, how do I convert a formula like: =MOD(MIN(IF(INDEX(I5#,,1)=N8,IF(INDEX(I5#,,3)=P8,ABS(INDEX(I5#,,2)-O8)+L5#))),1)

    To the actual value such as 01:12.35 without doing a manual Copy/Paste Special Values or running a macro?

    thanks in advance
    Attached Files Attached Files
    Last edited by JeffGrant; 03-20-2021 at 01:47 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Index/Match fails when the Match Criteria is determined by a formula result

    Floating point arithmetic is the problem (introducing rounding errors):

    =ROUND(8640000*MOD(MIN(IF(INDEX(I5#,,1)=N8,IF(INDEX(I5#,,3)=P8,ABS(INDEX(I5#,,2)-O8)+L5#))),1),0)/8640000

    and the formula then works fine.

    However, WHY do you want the address? 9/10 people think they want a cell address... when they really don't.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

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

    Re: Index/Match fails when the Match Criteria is determined by a formula result

    Floating-point removes some of the last digits.

    You may use rounding as in Glenn's formula or use this

    =INDEX(L5#,MOD(MIN(IF(INDEX(I5#,,1)=N8,IF(INDEX(I5#,,3)=P8,ABS(INDEX(I5#,,2)-O8)*10^6+ROW(L5#)))),10^6)-ROW(L4))
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: Index/Match fails when the Match Criteria is determined by a formula result

    Hi Glen, Are you still in lock down?

    what is the significance of 864000? For my conversion of time I use 24 * 60 * 60 = 86400. You have gone an order or magnitude higher? I will do some reading tomorrow about Floating point athematic to understand it better.

    The reason I need the cell address of this "nearest time" value is because I can then use the Offset function to get the distance associated with that nearest time match.

    From this I can then calculate speed in m/s and draw on a linear regression to adjust for overall time taken to travel the whole distance.

    From there I can compare an estimate race time against an historical race record.

    If the estimated race time is with a specified time difference from historical race record, then I get a green tick as part of the 24 analysis checks I make to accept the trade.

    Is there a better way to get the value in a cell two columns to the left of the address of the nearest time value?

    Chat soon.

  5. #5
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: Index/Match fails when the Match Criteria is determined by a formula result

    Thanks Bo-Ry, I have to say I have spent several hours on this in the last two days. The time value issue sure causes me a drama.

    It is late here in Oz, been a long day, I will be testing these out tomorrow, but for now, since both you are so knowledgeable in Excel, I will mark this thread as solved for now because I am certain that both of your solutions will see me smiling tremendously tomorrow.

    Thanks Man.

  6. #6
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: Index/Match fails when the Match Criteria is determined by a formula result

    Thanks Bo-Ry, I have to say that the formulas you and Glen wrote work perfectly with the Linear Regression. Thanks.

    But to ask a silly question, when you use referencing like A4# or A4#,,1 etc in an array, I understand what it does, but what is that type of referencing called?

    I want to learn more about it.

    Cheers

  7. #7
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: Index/Match fails when the Match Criteria is determined by a formula result

    Thanks Glen, this is a great solution, and works perfectly well with my linear regression. Now I also understand why I had so much problem with the floating point arithmetic.

    Excel, really does not like time that much - hey?

    cheers

+ 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. [SOLVED] How can i use Index and Match for 3 criteria to look for result
    By Eric Tsang in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-14-2019, 12:27 PM
  2. Replies: 1
    Last Post: 08-11-2016, 02:18 AM
  3. [SOLVED] Index match match with the column number determined by two rows???
    By bridge4444 in forum Excel General
    Replies: 2
    Last Post: 08-08-2016, 04:23 AM
  4. Array formula using INDEX, MATCH and INDIRECT fails with #VALUE
    By BikeJockey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-17-2016, 03:52 PM
  5. Replies: 1
    Last Post: 06-18-2015, 08:45 AM
  6. [SOLVED] Multiple criteria for Index and Match with if(and( & if(or( result #value?
    By v.rodgers in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-08-2015, 12:52 AM
  7. Replies: 2
    Last Post: 09-27-2014, 04:34 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