+ Reply to Thread
Results 1 to 11 of 11

If and Index reference with two columns

  1. #1
    Registered User
    Join Date
    01-26-2016
    Location
    TX
    MS-Off Ver
    Excel 2016
    Posts
    99

    If and Index reference with two columns

    All, I'm struggling with a formula that helps me index a reference to values in two columns. I know how to index to one column but I need a formula that says if column G doesn't have a value then pick column H. For the record, either one of these columns will have a value. I'm trying to get the value to populate in a second sheet.

    The formula M'm using currently is this =IF(A2="","",INDEX(Sheet1!$1:$1048576,MATCH(A2,Sheet1!J:J,0),7)) but if column G (7) doesn't have a value this doesn't work.


    I've attached a sample of what i'm referring to in an excel sheet as well. Sheet1 shows a sample of the data and sheet2 is where the results would go to.

    I'd appreciate any help.


    Thanks,
    Rookie
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: If and Index reference with two columns

    Maybe

    Please Login or Register  to view this content.
    Cheers
    Leo

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: If and Index reference with two columns

    Another option...
    =IF(A2="","",MAX(INDEX(Sheet1!$G:$G,MATCH(Sheet2!$A2,Sheet1!$J:$J,0)),INDEX(Sheet1!$H:$H,MATCH(Sheet2!$A2,Sheet1!$J:$J,0))))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,422

    Re: If and Index reference with two columns

    Another option array entered. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: If and Index reference with two columns

    Quote Originally Posted by FlameRetired View Post
    Another option array entered. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ..Sweet ..

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,422

    Re: If and Index reference with two columns

    Thanks.

    Another way does not have to be array entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: If and Index reference with two columns

    Try this ARRAY formula
    In C2 , then drag down
    Please Login or Register  to view this content.
    Confirm formula with Ctrl+Shift+Enter
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 06-23-2017 at 03:01 AM.

  8. #8
    Registered User
    Join Date
    01-26-2016
    Location
    TX
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: If and Index reference with two columns

    Fdibbins and FlameRetired - I'd like to use either of your formulas but I'm having an issue when the value in column G (account 1) is negative. The value in column H does work whether it's negative or positive.


    I'm not using formulas with arrays in this case because I have to sort the formulas.

    Thanks,
    Rookie

  9. #9
    Registered User
    Join Date
    01-26-2016
    Location
    TX
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: If and Index reference with two columns

    Nevermind! i figured out the issue! thank y'all for the help!

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,422

    Re: If and Index reference with two columns

    Good deal. Thank you for updating us.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: If and Index reference with two columns

    Always a good feeling when you resolve these yourself

    Thanks for the feedback

+ 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] Create an index keeping original index reference and appending new where necessary
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2016, 01:38 PM
  2. [SOLVED] Create an index keeping original index reference and appending new where necessary
    By BRISBANEBOB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2016, 01:34 PM
  3. [SOLVED] First column as reference, rest of columns as listing to reference
    By samuroeh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2016, 02:05 PM
  4. Index Function to reference cell 2 columns and
    By Stressed_Daniel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-04-2015, 04:30 AM
  5. INDEX MATCH with Rows and Columns as reference
    By Locust in forum Excel General
    Replies: 4
    Last Post: 06-11-2014, 02:35 PM
  6. Increment columns in INDEX and MATCH formula - ROWS and COLUMNS
    By nickmangan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 10:38 AM
  7. INDEX:INDEX as range reference
    By sweep in forum Excel General
    Replies: 6
    Last Post: 04-01-2010, 04:47 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