+ Reply to Thread
Results 1 to 9 of 9

Why isn't this OFFSET function working correctly !

  1. #1
    Registered User
    Join Date
    05-12-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Why isn't this OFFSET function working correctly !

    My OFFSET function expands down 1 row to many, can ayone tell me why?
    This is what I'm using for my pivot table so I always end up getting a "blank Field" in my pivot table.

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

    Col A

    Psword Teacher Month Infractions
    2350538 Obama h)Feb 1
    2350538 Obama i)Mar 1
    2350538 Obama j)Apr 7

    So when the above offset function is applied, it picks up the above 4 fields PLUS it adds a blank row to the bottom so it is actually picking up 5 fields...
    Can anyone HELP !!!!
    Last edited by jmccullough; 09-25-2009 at 01:07 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Why isn't this OFFSET function working correctly !

    It's counting all cells which have something entered in them. Is there another cell in Column A that has something in it (e.g. a title or something)? If not, select all the cells in column A excluding those 4 and "clear contents". Did that help?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-12-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Why isn't this OFFSET function working correctly !

    Thanks for the prompt reply but unfortunately that didn't help. I cleared the contents of every cell in Col A through row 1000 with no luck. Any other suggestions?

    Thanks

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Why isn't this OFFSET function working correctly !

    why stop at A1000 your OFFSET formula is checking every cell in column A

    Also how does you formula return 4 fields when the number of columns is set to 1?

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

    Perhaps you should post a workbook.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    05-12-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Why isn't this OFFSET function working correctly !

    Thanks for the reply, sorry my mistake, a mistype, I do have a 4 to check the number of columns.

    Do I really need to clear contents of Col A past row 1000? I will try that but if for example there is something in row 2000 Col A, why am I getting only 1 extra row?

    If clearing out all contents past row 1000 doesn't work, I will post workbook.

    Thank you for your help.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Why isn't this OFFSET function working correctly !

    The counta counts the number of rows with data. So assuming A2000 has content the result would be 5. So a 5 row offset from A1 would be the range A1:A5. And because A5 is blank that's where you blank item comes from.

    You can adjust the formula to just work with the 1st 1000 rows.

    =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A$1:$A$1000),4)

  7. #7
    Registered User
    Join Date
    05-12-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Why isn't this OFFSET function working correctly !

    Tried your suggestion but that didn't work either. I'm sure it's something dumb on my part. I have posted a copy of the workbook. From the Data Entry sheet, if you type in 2462531 in the password field if it's not already there it should display 10 records. The named range in question is called Chartdata.

    Thanks for taking a look, I really appreciate it and I hope it's something simple.

    Thanks again.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Why isn't this OFFSET function working correctly !

    A3 has a value in it. Either minus 1 from your COUNTA argument or start counting from A6
    Please Login or Register  to view this content.
    Working now?

  9. #9
    Registered User
    Join Date
    05-12-2009
    Location
    pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Why isn't this OFFSET function working correctly !

    AWESOME !!!! You are a lifesaver. I see my mistake now that you pointed it out (cell A3). Thanks for taking the time to help me out.

    Thanks again.

+ 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