+ Reply to Thread
Results 1 to 5 of 5

Dynamic Ranges and Blanks

  1. #1
    Registered User
    Join Date
    06-05-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Dynamic Ranges and Blanks

    Hello All,

    thank you in advance for your respones. I am having some trouble with some forumals and dynamic ranges.


    My goal is to return the First, Second and Third highest text values in a dynamic range. (The dyanmic range is a list that is constantly being added to, however, sometimes it will be blank)

    Everything works except the moment i skip a line in the dynamic range all values go NA


    For for example

    C1: =INDEX(vendor,MODE(MATCH(vendor,vendor,0)))
    C2: {=INDEX(vendor,MODE(IF(COUNTIF(C$1:C1,vendor)=0,MATCH(vendor,vendor,0))))}
    C3: {=INDEX(vendor,MODE(IF(COUNTIF(C$1:C2,vendor)=0,MATCH(vendor,vendor,0))))}

    This is the set that returns the first second and third highest values

    Column A is my dynamic range with the dynamic named range:

    =OFFSET(Sheet1!$B$1,0,0,COUNTA(Sheet1!$B$1:$B$100),1)

    the name is vendor.

    This works except for if i leave a blank space in column A it all stops working.

    What am i doing wrong?

    Thanks,

    Dan

  2. #2
    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,499

    Re: Dynamic Ranges and Blanks

    Probably best if you can post a sample workbook.

    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


  3. #3
    Registered User
    Join Date
    06-05-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Dynamic Ranges and Blanks

    Here is a sample book. If you delete anything within A1:A33 it will turn to NA
    Attached Files Attached Files

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

    Re: Dynamic Ranges and Blanks

    Use one more IF to check Vendor<>"",

    =INDEX(vendor,MODE(IF(vendor<>"",MATCH(vendor,vendor,0))))

    =INDEX(vendor,MODE(IF(COUNTIF(B$1:B1,vendor)=0,IF(vendor<>"",MATCH(vendor,vendor,0)))))

    FYI:

    If you are using COUNTA as length in OFFSET & you have blanks in ranges, will not give the accurate dynamic range.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Registered User
    Join Date
    06-05-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Dynamic Ranges and Blanks

    Quote Originally Posted by Haseeb A View Post
    Use one more IF to check Vendor<>"",

    =INDEX(vendor,MODE(IF(vendor<>"",MATCH(vendor,vendor,0))))

    =INDEX(vendor,MODE(IF(COUNTIF(B$1:B1,vendor)=0,IF(vendor<>"",MATCH(vendor,vendor,0)))))

    FYI:

    If you are using COUNTA as length in OFFSET & you have blanks in ranges, will not give the accurate dynamic range.


    This is returning NA regardless of the Data. do you think you could do this in the spreadsheet i attached so i can see it in action?

    EDIT: I forgot to array it CTRL SHFT ENTER - this works now

    THANK YOU SO MUCH
    Last edited by dhpeter83; 06-05-2012 at 10:25 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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