+ Reply to Thread
Results 1 to 11 of 11

Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

  1. #1
    Registered User
    Join Date
    03-21-2019
    Location
    London
    MS-Off Ver
    365
    Posts
    4

    Question Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Hey,

    I'm trying to use the below formula to build a naming convention:

    =IF(A8="Events",D8&"-"&PROPER(E8)&"-["&G8&"]"&"-{"&(IF(VLOOKUP(E8,'Keyword Ideas'!$A:$E,5,0)<>""),(TEXT(VLOOKUP(E8,'Keyword Ideas'!$A:$E,5,0)),"yyyy-mm-dd"),"")&"}",D8&"-"&PROPER(E8)&"-["&G8&"]")

    And am getting the error "There's a problem with this formula". When throwing the error, the "" (in red) ends up highlighted, but I'm not sure what the issue is. Anyone able to help?

    Much appreciated!

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    TryL
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    We would be able to help you better if you explain what you're trying to do rather than just posting a broken formula.

    Maybe

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by jason.b75; 03-21-2019 at 11:36 AM.

  5. #5
    Registered User
    Join Date
    03-21-2019
    Location
    London
    MS-Off Ver
    365
    Posts
    4

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Olly & dosydos have nailed it - thanks guys. For future reference, was the issue just that I was too liberal with brackets and a few needed removing?

    Thanks again!

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Yes, there were brackets in the wrong places - I also restructured the order of your formula, to make it a little more efficient ( you didn't need to repeat ( =D8&"-"&PROPER(E8)&"-["&G8&"]" ) twice.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. You may also 'Add Reputation' to those who helped you. Thanks.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Quote Originally Posted by Olly View Post
    I also restructured the order of your formula, to make it a little more efficient ( you didn't need to repeat ( =D8&"-"&PROPER(E8)&"-["&G8&"]" ) twice.
    I missed that bit, Olly. But you missed the second vlookup that wasn't needed

    edit:- combining both efforts

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Quote Originally Posted by jason.b75 View Post
    I missed that bit, Olly. But you missed the second vlookup that wasn't needed
    I resisted the temptation to rewrite as the more efficient INDEX / MATCH...

  9. #9
    Registered User
    Join Date
    03-21-2019
    Location
    London
    MS-Off Ver
    365
    Posts
    4

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Quote Originally Posted by Olly View Post
    I resisted the temptation to rewrite as the more efficient INDEX / MATCH...
    Feel free

    Thanks again guys

  10. #10
    Registered User
    Join Date
    03-21-2019
    Location
    London
    MS-Off Ver
    365
    Posts
    4

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Quote Originally Posted by jason.b75 View Post
    I missed that bit, Olly. But you missed the second vlookup that wasn't needed

    edit:- combining both efforts

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This one doesn't quite work actually - we need the control for

    IF(VLOOKUP(E8,'Keyword Ideas'!$A:$E,5,0)<>""

    otherwise the date gets returned as 1900-01-00. But thank you - not necessarily clear without the full use case in front of you.

  11. #11
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Anyone able to debug my formula? Nested VLOOKUPs, IF statements & TEXT functions

    Sorry, I had some serious brianfart going on earlier

    It should have eliminated the 1900-01-00 dates when the result of the vlookup was empty, but i put the &"" in the wrong place. Is should have been VLOOKUP(E8,A:E,5,0)&"" not after E8 as I did earlier.

    I also had A8="Events" in the wrong place.

    Correcting both of the above and rewriting with INDEX / MATCH, hopefully with no more silly mistakes

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I've also added an error trap, just in case E8 is not found in the list of keyword ideas.

+ 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. Nested Vlookups and If Statements
    By IheartIUP in forum Excel General
    Replies: 4
    Last Post: 09-15-2015, 01:16 PM
  2. Replies: 3
    Last Post: 07-26-2013, 01:22 AM
  3. [SOLVED] Nested IF statements that involve #N/A errors from vlookups
    By CorporateBatteryHen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2013, 02:03 AM
  4. Adding ISNA to long nested IF statements with vlookups
    By vgately99 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-07-2013, 02:59 PM
  5. Nested if statements with vlookups
    By txbullets in forum Excel General
    Replies: 4
    Last Post: 12-08-2011, 10:30 AM
  6. Replies: 12
    Last Post: 05-15-2009, 08:38 AM
  7. Nested IF functions with Search statements
    By swpowers27 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-12-2005, 04:28 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