+ Reply to Thread
Results 1 to 14 of 14

VLOOKUP /Index Match - Returning a value if conditions are met?

  1. #1
    Registered User
    Join Date
    07-26-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    16

    VLOOKUP /Index Match - Returning a value if conditions are met?

    Hi guys

    I'm looking for a way to get Excel to return a value if a date is matched.

    Please see attached.

    Any ideas on how to approach?

    Thank you in advance

    BR
    Crunchy
    Attached Files Attached Files

  2. #2
    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: VLOOKUP /Index Match - Returning a value if conditions are met?

    I am currently unable to view files, but have you tried using vlookup? It will return text or value if the conditions are met.

    If you have tried it, and it didnt work, are your dates real dates or text looking like a date? Test 1 or 2 with =isnumber(cell-ref)...FALSE indicates text and we will need to convert them
    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

  3. #3
    Registered User
    Join Date
    07-26-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    16

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    Dear PMFDibbins,

    Thank you for your swift response.

    I've tried using VLOOKUP, but I can't get it to return the appropriate value.

    I've reattached the file, please let me know if it works now.

    Thank you

    BR
    Crunch
    Attached Files Attached Files

  4. #4
    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: VLOOKUP /Index Match - Returning a value if conditions are met?

    As I said above, I am currently unable to view files

    Did you try my test to check that you have real dates?
    Can you show me a sample of your formula?

  5. #5
    Registered User
    Join Date
    07-26-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    16

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    Dear FDibbins

    I've set up the following in a Pivot table. This is the first table:

    Spending Income Value
    NAME A
    1993/12 -12515
    1994/05 -526316 10526
    1994/11 -1157895
    1995/02 -464342 8421
    1995/05 -143082 6410
    1995/08 -152439 6219
    1995/11 -202865 7786
    1996/02 -2354640 8421


    Which I'm trying to match

    Date 1 S&P 500
    1993/12 100
    1994/01 96.99550042
    1994/02 92.55829465
    1994/03 93.62555139
    1994/04 94.78624078
    1994/05 92.24683932
    1994/06 95.15168378
    1994/07 98.72926326
    1994/08 96.075664
    1994/09 98.07728675
    1994/10 94.20278153
    1994/11 95.36139268
    1994/12 97.676549
    1995/01 101.2001475
    1995/02 103.9658659
    1995/03 106.8727888
    1995/04 110.7535227
    1995/05 113.1101964
    1995/06 116.7043906
    1995/07 116.6670174
    1995/08 121.3450699
    1995/09 120.7408522
    1995/10 125.6971437

    So what I'm trying to do is:
    If Date Table 1 matches Table 2, then return 100.


    This is just a sample, I have significantly more observations and "Names", thus, I'm looking for a way to automatize this calculation.

    BR
    Crunch

  6. #6
    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: VLOOKUP /Index Match - Returning a value if conditions are met?

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,700

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    In D4 copied down:

    =IFNA(VLOOKUP(A4,$J$4:$K$298,2,0),"")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    07-26-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    16

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    Dear AliGW

    Thank you! Exactly what I was looking for!!! :-)

    BR
    Crunch

  9. #9
    Registered User
    Join Date
    07-26-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    16

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    Thank you FDibbins for you reply.

    I'll do so next time around, AliGW solved the issue.

    Thank you for your time.

    BR
    Crunch

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,700

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    You're welcome.

    I suggest you do a bit of reading around the basic VLOOKUP, HLOOKUP and INDEX MATCH MATCH combinations that are used a lot. There are loads of tutorials if you Google.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,700

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    I've marked the thread as solved for you this time. Please do this yourself next time. Thanks.

  12. #12
    Registered User
    Join Date
    07-26-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    16

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    Thank you for your assistance.

    I tried, but to no avail.

    May I pick your brain for a second?

    Is there any way to return a formula: I'm trying to re-index my variables for each customer e.g. if customer name changes, then I need Excel to calculate a new index benchmark for that particular variable. And I need it to do so for all customers. But it needs to still match the dates...

    Thank you.

    BR
    Crunch

  13. #13
    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: VLOOKUP /Index Match - Returning a value if conditions are met?

    If your customer name changes, but all other info stays the same for that customer, I think you may be better off adding a new customer record with the new name. Otherwise all liknks to the old customer name will no longer work

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,700

    Re: VLOOKUP /Index Match - Returning a value if conditions are met?

    I've just seen this.

    This is bad data handling. All customers should have a unique ID that never changes. This will then mean that any personal details that change (name, address, etc.) will not affect any calculations for that customer: the unique ID will be used to identify them and lookup their details in other tables.

    This is one of the basic rules of relational database design: unique primary keys. This should be employed in any Excel set-up where you have inter-dependent tables.

    The name should NEVER be that unique key - the name might change. The unique ID never will: it is the constant.

+ 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] Returning Non-Zero Vlookup/match/index
    By leomiah in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-02-2018, 09:02 AM
  2. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  3. Index/Match or VLookup returning Multiple Results
    By Stoppeh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2014, 08:31 PM
  4. Replies: 6
    Last Post: 03-01-2014, 11:56 PM
  5. [SOLVED] Need help with vlookup/INDEX MATCH in getting a value using 2 different conditions
    By muheebrahman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2013, 06:44 AM
  6. Replies: 13
    Last Post: 12-13-2012, 11:44 AM
  7. [SOLVED] INDEX - MATCH - VLOOKUP - returning missing reference
    By njuneardave in forum Excel General
    Replies: 2
    Last Post: 06-27-2006, 02:50 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