+ Reply to Thread
Results 1 to 7 of 7

Returning a cell value via matching 2 cells & rounding another down to match a third value

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    3

    Returning a cell value via matching 2 cells & rounding another down to match a third value

    Hello all,

    I have a problem that is doing my head in. I have a two sheet workbook (sample attached). sheet1 has 4 columns (titled SH, RS, RP and ID). The first two have data that is needed to match with data in sheet 2, the third column (RP) will usually never match sheet2, so via the formula I need, it will use this RP as an input, but not a matched input (I need it rounded down to the nearest match (round sheet1 RP down to the nearest sheet2 RP)). The fourth column in sheet1 is the one I need the formula for (the ID column).
    The SH and RP values exist in both sheets. The RP values vary.
    What I need the formula to do is, get the value from sheet1 in the SH column (say cell A2) and the RS value (B2), and the RP value (C2), and find the ID value in sheet2 where the SH and RS values are identical, and the RP in sheet1 is rounded down to match that in sheet2

    So if sheet1 has:
    SH = 2A
    RS = 0
    RP = 1.967
    ID = (formula I need)

    It will find in sheet 2:
    SH = 2A
    RS = 0
    RP = 1.3 (sheet2 has 10 SH=2A / RS=0 entries as there are 10 RP values, and as RP=1.967 does not exist in sheet2, it rounds down to the nearest sheet2 RP which is 1.3)
    Then from the above, returns the ID value from sheet2 (in this case 2662) in to sheet1 ID cell.

    The above is row 8 information from the attached workbook.

    So basically match the SH and RS for sheet1 and sheet2, get the RP in sheet1 and find the matching RP in sheet2 by rounding down the sheet1 RP to "match" sheet2 RP, and return the ID from sheet2 in to the ID in sheet1.

    I hope that all made sense.

    Thanking you all,

    Simon
    Attached Files Attached Files

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Returning a cell value via matching 2 cells & rounding another down to match a third v

    What is expected output if SH or RS does not match; or, if SH and RS do no not match? (blank,"Error", "No Match"...???) ? (I' am asking as this situation does occur in your sample, and there is no expected output shown)
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Returning a cell value via matching 2 cells & rounding another down to match a third v

    The attached was a portion of the total data, so at my end they exist (in theory...). Putting "No Match" in the ID cell would be great though, to be safe.

    Thanks.

  4. #4
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Returning a cell value via matching 2 cells & rounding another down to match a third v

    I thought that might be the issue, but, without something to see, I wasn't going to risk it

  5. #5
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Returning a cell value via matching 2 cells & rounding another down to match a third v

    See if this in D2 works for you:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag/Extend down

    Hope this helps

    EDIT-
    This does make the assumption that the 'Sheet2' data is set up the way you have in the example (ie-, the values in column C are sorted as ascending according to the match they have.. ), If not, I will need a more complex set of data to work with..
    Last edited by dredwolf; 04-30-2013 at 02:25 AM.

  6. #6
    Registered User
    Join Date
    04-29-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Returning a cell value via matching 2 cells & rounding another down to match a third v

    Good god man!!
    Now for the fun part of working out how you did what you did!!

    dredwolf: you are a legend

    Many, many thanks.

  7. #7
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Returning a cell value via matching 2 cells & rounding another down to match a third v

    You are welcome
    and a hint for analyzing, the sumproducts() are the same, one is use ensure that a there is a match to the criteria, the second returns where the match is

+ 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