+ Reply to Thread
Results 1 to 21 of 21

Multiple IF statements with VLOOKUP

  1. #1
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Multiple IF statements with VLOOKUP

    I have read all the posts and goggled this but still cant seem to get it to work. I am trying to select a project through a lookup and then do an “if” to define the stage. I can do both, but not together. I need to combine these two statements:

    I have a project tracking sheet I present to management, column A has a list of project (could be a different view of different project) and later columns have sequential dates which have to list the project phase (Define, Design, Develop, etc..) in the cell.
    All data is in the Master tab. It will have the Project and the current dates for each project phase.

    The VLOOKUP finds the project in Column "A" in the Master tab and the IF checks the various phase dates in the Master tab to find the project phase and assign it.


    =IF(D4<='Master List of Projects'!$P$5,'Master List of Projects'!$O$2,IF(D4<='Master List of Projects'!$R$5,'Master List of Projects'!$Q$2,IF(D4<='Master List of Projects'!$T$5,'Master List of Projects'!$S$2,IF(D4<='Master List of Projects'!$V$5,'Master List of Projects'!$U$2,IF(D4<='Master List of Projects'!$X$5,'Master List of Projects'!$W$2,IF(D4<='Master List of Projects'!$Z$5,'Master List of Projects'!$Y$2,IF(D4<='Master List of Projects'!$AB$5,'Master List of Projects'!$AA$2)))))))

    and

    =VLOOKUP(A7,'Master List of Projects'!$B$5:$AH$53,1,FALSE)

    Morning, I have posted a striped down sample doc link below. Basically what I am trying to do is combine the formulas from cell D6 and D7 into one cell.

    Thank you.

    https://docs.google.com/spreadsheets...gid=1306745872

  2. #2
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Multiple IF statements with VLOOKUP

    Upload the file directly...the URL doesn't work.
    Want to show appreciation for the help you received from a member? Give them reps by clicking the bottom left of their post!

  3. #3
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    Sample Reporting v4.xlsx

    OK, I will upload it now.

    Thanks.

  4. #4
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Multiple IF statements with VLOOKUP

    Maybe I'm not understanding your request correctly...but why do you even need the VLOOKUP? The output and the input of your VLOOKUP is the exact same.

  5. #5
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    In the IF statements the rows are hard coded but can not stay that way. As I stated, column A has a list of projects (could be a different view of different projects depending on the request), so the formula needs to read column A to match the project to the Master data tab to obtain the IF data.

    If here is another way to do that I am open to suggestions.

  6. #6
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    I'm going to guess what you really want is an INDEX MATCH function,
    Tell me if this is looking similar to what you want. You can now edit Column A to pull up values.

    If you need anything changed or explained I'll be happy to.
    If I did it wrong try and communicate better what you would like as the final result for a single column.

    Red
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    This looks like it could work. What I want to return aren't the dates though, its the corresponding phase (Identify, Design, etc. in ROw2 of the Master Data tab) in the Dashboard cells. I can try and work with it and figure it out.

    Thank you, very much.

  8. #8
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    The column has to be dates and the results the phase, not the opposite way.

  9. #9
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    I am not sure I can get this to work, the date in the Master Tab has to determine the Phase listed on the Dashboard Tab, that is why I used the IF statements.

  10. #10
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    I figured it out!
    That really took me a while to wrap my head around...

    I used CHOOSE and a COUNT formula instead of all of those IFs. This let me count all the End Dates (There were 7 phases) and because the dates are sequential I can say, for example, if there are 3 end dates counted that are less than or equal to that ROW 32 date, then it is within the Design phase and so on.

    I use a OFFSET function with a MATCH function to come up with a way to shift the rows looked at on the Master List to always be the same project name listed on the dashboard row.

    =IFERROR(
    CHOOSE(
    COUNTIFS(
    OFFSET('Master List of Projects'!$E$5:$R$5,
    MATCH($A6,'Master List of Projects'!$B$1:$B$35,0)
    -5,0),"<="&D$32,
    'Master List of Projects'!$E$3:$R$3,"End"),
    "Identify","Define","Design","Develop","Launch","Embed","Close"),
    "Identify")

    See the sheet attached

    Let me know if this is getting there!
    Red
    Attached Files Attached Files
    Last edited by RedSummer; 11-11-2015 at 03:00 AM.

  11. #11
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    AWESOME RED!!!! I will try it right now! Thanks much!!!

  12. #12
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    Red, one question. You have $E$5:$R$5 coded so it will look at that line in the Master tab for dates, which is project 1. How will it know to go to an different line dependent on the Project in Column A? Example the second project listed in the Dashboard is Project 27 in column A, it should look at the Master Tab and go to Row 31 for the dates.

  13. #13
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    OFFSET('Master List of Projects'!$E$5:$R$5,MATCH($A6,'Master List of Projects'!$B:$B,0)-5,0)

    Sure, so we want to look at a different row depending on the project name in column A

    MATCH($A6,'Master List of Projects'!$B:$B$,0)
    This looks at $A6 = Project 1 and will change as the formula is dragged down.
    It finds the Row # where Project 1 is in Column B. In this case the MATCH returns the number 5.

    The OFFSET formula works like this:
    OFFSET (RANGE , Row to change by, Column to change by)

    Knowing that our match returns Row 5, we will use match to change this range by a certain number of rows, this makes it match the projects numbers.

    My only issue with this right now is your input of dates. If there aren't all END dates written it won't work. I'm working on it now to figure out how to make it work in all cases.

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Multiple IF statements with VLOOKUP

    Hi Barry,
    I hope below formula work.
    In D6:
    =IFERROR(INDEX('Master List of Projects'!$E$2:$R$2,MATCH(TRUE,D$32<=VLOOKUP($A6,'Master List of Projects'!$B$2:$R$33,{5,7,9,11,13,15,17},0),0)*2-1),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Drag down and accross.
    Quang PT

  15. #15
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    Bebo, the projects are liable to change so using {5,7,9,11,13,15,17} hard coded won't be the best solution

    I'm intent on using an OFFSET MATCH to get the right row but it's increasingly annoying to test it out. I'm nearing it though

  16. #16
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    OKAY.

    This is the way I have done it.
    I added a row below your phases on the master sheet so that the Identify, etc., was not merged. You should hide this row, do not delete the merged one.

    The formula is a monster because of the lookup reference range I used to match the dates in the master list to the project name in the dashboard
    OFFSET('Master List of Projects'!$E$6:$R$6,MATCH(Dashboard!$A6,'Master List of Projects'!$B:$B,0)-6,0)
    let's call it ROWDATES)

    =IFERROR(
    INDEX('Master List of Projects'!$E$3:$R$3, , MATCH(
    INDEX(ROWDATES,MATCH(Dashboard!D$5,ROWDATES,1)),
    ROWDATES),
    "")

    I know it's super complicated but check out the sheet!

    Red
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    All the end dates WILL be field out, it is part of our project requirements. Its looking great, I appreciate the quick response on this forum.

  18. #18
    Registered User
    Join Date
    11-10-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple IF statements with VLOOKUP

    Looks like its working. I will review with my team tomorrow. Thanks again Red!!!!

  19. #19
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    Let me know if the last attached file has everything you need.
    If not let me know~

    If you are satisfied feel free to add reputation to me :D

    Red

  20. #20
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Multiple IF statements with VLOOKUP

    Quote Originally Posted by RedSummer View Post
    Bebo, the projects are liable to change so using {5,7,9,11,13,15,17} hard coded won't be the best solution

    I'm intent on using an OFFSET MATCH to get the right row but it's increasingly annoying to test it out. I'm nearing it though
    {5,7,9,11,13,15,17} represent for {Identify, Define,...,Close} column, I think they are fixed.
    And my formula also is dynamic for project number.
    Basically, I use VLOOKUP(project#,range,{1,3,5,7,9},0) to establish date range of project#.
    After that, compare D32 (current date) to that date range to find down the fist date that less than.

    Please Login or Register  to view this content.
    Test it again and tell me what's wrong with it.

  21. #21
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Multiple IF statements with VLOOKUP

    It's really clever,
    It comes to different conclusions on the values than mine, and I'm a little confused...
    Can you tell me what is going on in this sheet?
    The top one is what I had and i tried including a bottom one with yours
    Attached Files Attached Files

+ 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] Problems connecting multiple If and VLOOKUP statements
    By thomas.lyons in forum Excel General
    Replies: 11
    Last Post: 12-30-2014, 02:02 PM
  2. Replies: 3
    Last Post: 07-25-2013, 08:25 AM
  3. Replies: 7
    Last Post: 11-13-2012, 11:46 AM
  4. Replies: 7
    Last Post: 03-18-2012, 01:44 AM
  5. Replies: 3
    Last Post: 09-08-2011, 02:40 AM
  6. Using vlookup and if/then statements for multiple tables
    By HP RodNuclear in forum Excel General
    Replies: 9
    Last Post: 04-06-2011, 05:15 PM
  7. if statements depending on multiple VLOOKUP functions
    By njuneardave in forum Excel General
    Replies: 1
    Last Post: 06-21-2006, 11:40 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