+ Reply to Thread
Results 1 to 7 of 7

How to compare to columns for first > number and return results from a third colum

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    How to compare to columns for first > number and return results from a third colum

    Hi guys!

    What I would like to do is to be able to compare the numbers in column Y to the numbers in Column X, find the first instance where Y is > X (in this case 13) and then return the corresponding result that is located in the same row but in column Z ie 6 in this case. I can do it with a helper column that uses IF and then a simple Index-Match from there but I was wondering if there is a way to do it all in one formula?

    Z X Y
    1 5 2
    2 6 3
    3 7 6
    4 8 7
    5 9 8
    6 10 13
    7 11 15
    8 12 17

    Thank you!!!

    Chin
    Attached Files Attached Files
    Last edited by chinchillin; 03-25-2015 at 03:05 PM. Reason: Added workbook

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: How to compare to columns for first > number and return results from a third colum

    This could be an option, confirmed as an array formula with CTRL+SHIFT+ENTER:

    Please Login or Register  to view this content.
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    Re: How to compare to columns for first > number and return results from a third colum

    Thank you mcmahobt! Can you explain the -3 at the end?

  4. #4
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: How to compare to columns for first > number and return results from a third colum

    The result of the formula relies on a row number. Because the data table beings in Row 4, this presents a bit of an issue.

    The INDEX formula expects the ROW within the Table, not the absolute row number. So when the absolute Row Number of 6 is returned, this is really Row 3 of the table, hence we subtract 3. If you table started with A3, we'd go -2. Likewise, were it A100, we'd go -99.

    Make sense?

  5. #5
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: How to compare to columns for first > number and return results from a third colum

    The -3 accounts for your data starting on row 4, not row 1. This can be avoided by changing the INDEX range to include A1, but this keeps things neater in my opinion.

  6. #6
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    Re: How to compare to columns for first > number and return results from a third colum

    Thank you it does!

  7. #7
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    Re: How to compare to columns for first > number and return results from a third colum

    Thank you for the help and response I really appreciate it!!! Hopefully itll finally work

+ 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. Compare Columns and Display Results
    By punkin44 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-04-2014, 10:14 PM
  2. [SOLVED] compare tabs and return results in report tab
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-04-2014, 12:04 PM
  3. Replies: 5
    Last Post: 09-22-2012, 09:53 AM
  4. Replies: 1
    Last Post: 11-05-2010, 12:44 PM
  5. How to compare two columns and filter results ?
    By ASP__DEVELOPER in forum Excel General
    Replies: 8
    Last Post: 04-17-2010, 11:00 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