+ Reply to Thread
Results 1 to 6 of 6

Output a matching value from my table based on several criteria

  1. #1
    Registered User
    Join Date
    02-28-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2010
    Posts
    4

    Output a matching value from my table based on several criteria

    i have attached an image of an example of my dilemma. Firstly the table with headers degree, start, end and lvl is data that i have created. in the second table with the headers lean angle and slip are the data collected. What im trying to do is create a formula that firstly finds the same lean angle from the second, and match it to the first table so, identifies which row its needs. I then need it to say whether the value of slip falls within the range of the start and end value so for example the first lean angle is 0.00, so it would identify that the value of 0.00 in the first table is in B3 it would then look across row 3 and use the slip % from table 2 and determine whether it falls between the start value of 8.001 and the end value of 10. If it did teh answer would be an output of level 1. I have been using the index and match functions, but am having trouble trying to get the horizontal readings to occur on the row in which the degree andle is located. heres the formula ive been working on but i just can get the second part to work if it is dragged.

    forum help.PNG

    =INDEX($E$2:$E$5002, MATCH(1,(AF2=Degreelevel1)*(1=(IF(AND(AG2>=MIN(C:C,D:D),AG2<=MAX(C:C,D:D)),1,0))),0))

    This is from my actual data so doesnt match up with the table data attached. so ill explain which part is which.
    The 'e2:e5002' is the lvl colomn, the 'AF2' is a lean angle value, 'degreelevel1' is the degree column, 'AG2' refers to slip.
    Once again ill try explain what i want;
    i need it to find where in the table the degree of lean is, then i need it to see whether the slip value falls within the start and end value at that angle of lean, if it does then i want it to be come the number in the level column otherwise make it a zero or error or something.

    Please help if you can as im stuck!!1
    Thanks



    PS would also like to add, i know the example pics only has readings that only have 0 degree lean, but i have 34000 rows of data which has varying lean angles hence the need for a formula that i can drag down
    Attached Images Attached Images
    Last edited by NBVC; 02-29-2012 at 11:16 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need help trying to output a value from my table?? HELP!!

    Perhaps:

    =INDEX($E$2:$E$5002, MATCH(1,INDEX((AF2=$B$2:$B$5002)*(AG2>=$C$2:$C$5002)*(AG2<=$D$2:$D$5502),0),0))

    make sure all ranges are the same size (whether named or not).

    This may also work:

    =SUMIFS($E$2:$E$5002,$B$2:$B$5002,AF2,$C$2:$C$5002,"<="&AG2,$D$2:$D$5502,">="&AG2)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    02-28-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2010
    Posts
    4

    Thumbs up Re: Output a matching value from my table based on several criteria

    cheers mate, on first glance seems as if the first one has worked. will try it for my entire data set and validate.
    Thanks again been at this for a few days

  4. #4
    Registered User
    Join Date
    02-28-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Output a matching value from my table based on several criteria

    I have now tried both equations, and both are unsuccessful when it changes to different lean values. I have attached another pic of one of the areas which isnt correct.

    forum help 2.PNG

    ive highighted 2 sections that should be level 1 when outputted. it seems that the issue is something to do with when it identifies the row number of the degree it doesnt use the just the two values of start and end from that row. Its almost there i think,and i dont mind whether the result needs to be calculated by more than one equation in a few steps if this is of any help.
    Thanks again

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Output a matching value from my table based on several criteria

    It would be more helpful if you added a worksheet example in .xls format rather than a picture, so it would be able to diagnose and test solutions....

    Are you sure the numbers in the Degree column exactly match the numbers in the Lean Angle column (i.e. expand the decimal places to see)...?

  6. #6
    Registered User
    Join Date
    02-28-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Output a matching value from my table based on several criteria

    Thanks again youve solved the problem, i hadnt 'roundup' my lean values to 2 decimal places, now it works fine. Thanks again you been very helpful

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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