+ Reply to Thread
Results 1 to 34 of 34

VLOOKUP Issues

  1. #1
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    VLOOKUP Issues

    Hi,

    In the attached workbook on the FRI sheet (F83) I have a VLOOKUP formula that is giving me an error. =VLOOKUP(MAX(C32:D39,C54:D61,C71:D78),(C32:D39,C54:D61,C71:D78),1,FALSE)

    I want the formula to look through the C32:D78 ranges to find the greatest value and then display the corresponding value from column A, which is a time. I compiled the formula from something I saw on another site, but it is giving me the #N/A error. Eventually, this formula will make its way onto each page of the woorkbook.

    Extra points for someone who can provide the formula to take all 7 of these eventual results (1 from each sheet) and add them to the actual SUMMARY worksheet in a yet to be determined field...especially if it can show the most-frequently occuring value if there is one.

    Thanks in advance!!!
    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,926

    Re: VLOOKUP Issues

    I would suggest that you do away with ALL of the merged cells/columns that you have there - they cause nothing but problems, and are in fact another reason that your formula is not working...
    =VLOOKUP(MAX(C32:D39,C54:D61,C71:D78),(C32:D39,C54:D61,C71:D78),1,FALSE)
    needs to be...
    =VLOOKUP(MAX(C32:C39,C54:C61,C71:C78),C32:C78,1,FALSE)

    And if you change your SUM() formulas for the TOTAL's, to this...
    =SUBTOTAL(9,C71:D78)
    Then you can simplify it further tho this...
    =VLOOKUP(SUBTOTAL(4,C32:C79),C32:C78,1,FALSE)
    Last edited by FDibbins; 12-14-2013 at 05:00 PM.
    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
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,302

    Re: VLOOKUP Issues

    I think you are getting the C:D ranges because of the merged cells.

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


    But, if you want to return column 1, there's no point doing a VLOOKUP. Just do the MAX:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Someone else can have the extra points



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  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,926

    Re: VLOOKUP Issues

    Not really sure what i need to do for the "extra points", but if you want to add all values in a specific cell across sheets, this wull do it for you...
    =SUM(SAT:FRI!F83:F83)

  5. #5
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Quote Originally Posted by TMShucks View Post
    I think you are getting the C:D ranges because of the merged cells.

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


    But, if you want to return column 1, there's no point doing a VLOOKUP. Just do the MAX:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Someone else can have the extra points



    Regards, TMS
    The absolute value will alleviate the issue of having merged cells? I'd hate to have to go back and start making widespread changes.

    EDITED: I tried the first half, and all it did was give me the MAX value, not the corresponding value from Column A
    Last edited by tapsmiled; 12-14-2013 at 05:04 PM.

  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,926

    Re: VLOOKUP Issues

    Quote Originally Posted by TMShucks View Post
    But, if you want to return column 1, there's no point doing a VLOOKUP. Just do the MAX:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Good point Trevor, I guess I got too wrapped up in fixing and simlifying, so then just...
    =SUBTOTAL(4,C32:C79)

  7. #7
    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,926

    Re: VLOOKUP Issues

    Quote Originally Posted by tapsmiled View Post
    The absolute value will alleviate the issue of having merged cells? I'd hate to have to go back and start making widespread changes.
    No it wont. They can stay, just know that any range you construct using the mouse for, say, C, will also incude D, and may need to ne modified

  8. #8
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    When I added your formula to the workbook, it gave me the number 12, which is the highest value, but what I really want is "1800-1900" which was the corresponding value in Column A.

    =VLOOKUP(MAX($C$32:$C$78),($C$32:$C$78),1,FALSE)

  9. #9
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: VLOOKUP Issues

    This part:
    Quote Originally Posted by tapsmiled View Post
    I want the formula to look through the C32:D78 ranges to find the greatest value and then display the corresponding value from column A, which is a time.
    is quite clear to me. You cannot use VLOOKUP to return results from the column, which is located left from the searched one. Instedad you cen use combination of 2 functions INDEX and MATCH in one formula:
    Please Login or Register  to view this content.
    As for the second part of your question:
    Of course you can list "rush hours" for each day in the Summary sheet in a similar way you listed there for instance total calls. So once you copy the above formula into other days sheets, in a designated cell write:
    Please Login or Register  to view this content.
    and so on.

    Alternatively, you could include sheetname in the formula and then it works no matter in which sheet is located. for example:
    Please Login or Register  to view this content.
    If you plan to find most frequent (in a given week) hours, and if there is a chance that some days (as it is now) have no data at all this formula shall be included inside IF function, like:
    Please Login or Register  to view this content.
    And last thing - showing the most frequent one (if there is one) can be done with conditional formatting of the cells with these formulas in summary sheet.
    For instance the simple way - using a formula for formatting rule - in the attached file I selected in summary sheet range A25:G25
    and used the folowing formula for conditional formatting rule
    Please Login or Register  to view this content.
    This is not exactly the most frequent, but one which occured twice or more. I do not know nature of the business, but it is probably worth noticing if for instance there were 2 most fequent hours.

    Kopia DSR (BLANK BETA).xlsx

    Hope it helps,

  10. #10
    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,926

    Re: VLOOKUP Issues

    Try this...
    =INDEX($A:$A,MATCH( SUBTOTAL(4,C32:C79),$C:$C,0))

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,302

    Re: VLOOKUP Issues

    Just going with the broken formula that you had. You need:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS

  12. #12
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Wow, that is a lot to absorb. The first formula Kaper posted worked perfectly.

    Can you please explain the last formula you posted and how I would apply that to the SUMMARY page. Let's say that I applied the first formula to every sheet in F83 and SUMMARY!H26 is where I wanted to show the busiest hour(s) of the week. I understand that I could potentially have up to 7 possibilities here (if each day had a different time of occurence for the MAX or if 2 days had the same exact MAX).
    Last edited by tapsmiled; 12-14-2013 at 05:50 PM.

  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,926

    Re: VLOOKUP Issues

    @ TMS, a pure MAX() wont work because there are totals inside that range

    @ tapsmiled, Maybe add a small tabl;e to the SUMMRY sheet than pulls in all the times from each sheet - you can then see at a glance what the most rfrequent times are - or if there are any at all

  14. #14
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: VLOOKUP Issues

    Quote Originally Posted by tapsmiled View Post
    Wow, that is a lot to absorb. The first formula Kaper posted worked perfectly...
    Hello tapsmiled,

    I don't think so this will work, since you have TOTAL cell in col A.

    Check this.

    Enter 13 in C34 & C35, so total will be 26

    Enter 26 in C60, so Total will be 26

    That formula will give you output TOTAL. Since 26 is the MAX value actual needs to be A60? 1300-1400

    So try this Array Formula with CTRL+SHIFT+ENTER

    =INDEX(A32:A78,MATCH(1,IF(A32:A78<>"Total",IF(C32:C78=MAX(IF(A32:A78<>"Total",C32:C78)),1)),0))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  15. #15
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    I actually like the idea of a chart, though I dont know how I would apply my results to it.

    For clarification, this is for a group of 911 call centers. The number of calls can vary from as little as 2 to over a hundred, depending upon how busy each center is. For statistical purposes, we have to achieve standards above 90%, and this is based upon the busiest hour of the day. Each week, the supervisors for each center need to report their numbers, and I want to simplify the process.

  16. #16
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Thank you Haseeb. It actually did work. When there are no numbers entered, it reads TOTAL, and when there is data, it is correctly selecting the appropriate value from column A.

  17. #17
    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,926

    Re: VLOOKUP Issues

    In its simplest way, something like this....
    A
    B
    29
    Sat
    0
    30
    Sun
    0
    31
    Mon
    0
    32
    Tues
    0
    33
    Wed
    0
    34
    Thur
    0
    35
    Fri
    1800-1900

    ...with this in B29, copied down...
    =INDIRECT(A29&"!F83")

    You use this same method to pull in other cell refs from those sheets

  18. #18
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Wow, am I really this dumb? I hid all of the rows at the bottom of each page. How do I show them again so that i can try to enter the chart? I know....noob question

  19. #19
    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,926

    Re: VLOOKUP Issues

    click on the last riow number, right click - unhide

  20. #20
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Tried that; it didnt work.

  21. #21
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: VLOOKUP Issues

    Select a whole column, eg: Column K

    Home >> Format >> Hide & Unhide >> Unhide Rows

    or press Ctrl+Shift+(

  22. #22
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Tried that too. I don't get it.

  23. #23
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: VLOOKUP Issues

    What about, Selct a whole column, then

    Home >> Format >> AutoFit Row Height.

  24. #24
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    I tried that as well. If you look at the workbook in the original post, you will see that B28 is the last visible row on SUMMARY. Nothing I have tried has revealed B29+

  25. #25
    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,926

    Re: VLOOKUP Issues

    If you click on the row number (28) and "drag down" as if there was another row beneath, then right-click on 28, select unhide

  26. #26
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Quote Originally Posted by FDibbins View Post
    If you click on the row number (28) and "drag down" as if there was another row beneath, then right-click on 28, select unhide
    That did it, though it completely locked up my computer for about 10 minutes. Okay...back to that chart now.

  27. #27
    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,926

    Re: VLOOKUP Issues

    hmm when I did it (2007 on a not-really-great PC) it was almost instant, but as long as you got there

  28. #28
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    I did eventually. Regarding that chart now...I did as you instructed, and it returned the earliest times with the MAX value. Is there a way, using your formula, to post ALL of the times =MAX. In other words, if 3 (or more) separate times have the same total, could I list each of those times on the chart?

  29. #29
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Here is the latest version of the workbook. As you can see on SAT, there are 3 separate instances where the call volume =10 (the MAX), but at the bottom (F83) and on the SUMMARY, it only lists a single instance rather than each instance. I know the calculation in F83 is the one that needs to be altered; I just dont know how.

    Actually, the file is too large now to upload

  30. #30
    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,926

    Re: VLOOKUP Issues

    So you are saying you may, for instance on FRI, have more than 1 entry with 12?

    Take a look at the attached. I added a helper column (to each sheet) to pull out duplicate qty's. Then I created a table on the summary sheet which goes to 5 - you can extend it by just increasing the columns right-wards.

    Let me know if this is what you are after?
    Attached Files Attached Files

  31. #31
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    That would do it, but it seems like I would have to make massive alterations to what I just finished writing. You are awesome though. I guess I will have to leave it as it is.....can't hand them EVERYTHING on a silver platter. LOL

  32. #32
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Thank you to everyone who contributed!!! You guys are great!!!

  33. #33
    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,926

    Re: VLOOKUP Issues

    Happy t5o help, look forward to assisting you further Thanks for the feedback

  34. #34
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: VLOOKUP Issues

    Thank you!

+ 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] Vlookup Issues
    By AndianAtWork in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-03-2013, 02:28 AM
  2. vlookup issues
    By griff6r in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-22-2013, 11:16 AM
  3. Please help - VLOOKUP issues!
    By banyard2000 in forum Excel General
    Replies: 2
    Last Post: 10-29-2010, 03:26 AM
  4. VLOOKUP issues
    By mojobaabby in forum Excel General
    Replies: 1
    Last Post: 09-23-2010, 08:37 PM
  5. VLOOKUP issues
    By performrad in forum Excel General
    Replies: 5
    Last Post: 07-19-2010, 11:44 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