+ Reply to Thread
Results 1 to 12 of 12

How to fix formula "=subtotal(3,B$2:B2)"

  1. #1
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    How to fix formula "=subtotal(3,B$2:B2)"

    Hi everyone,

    I need your help in fixing the above formula. The thing is, I have an expense table(Using the insert > insert table), I used the above formula for COL A and then COL B for the dates, the problem is that when I filtered my data in the Dates COL the newly added data will be included also in the filter even if the data doesn't match the filter and sometimes after I deleted the filter some of my records are missing which means it was hidden automatically.

    Sample output after filtering the COL B to 4/01/2011,

    A B
    1 4/01/2011
    2 4/01/2011
    3 4/01/2011
    4 4/01/2011
    5 9/01/2012

    Please help. I tried searching it in google, using a vba function it didn't work either.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    Hi tangangtanga,

    Please upload a sample file to support your query. Thanks.

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    Hi,

    Please see attached workbook this is the actual workbook that I'm workin on right now. Don't mind the summary sheets just the other sheets.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    Please help..

  5. #5
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    Strange one. If I filter for 4/1/12, I get one extra row with a date of 11/1/12. If I clear the filter (by choosing 'Select All') and then filter again for 4/1/12, I now get two extra rows. This continues to add a row for each unfilter/filter iteration. Looks like your table is referencing the correct range. I'll have to keep playing with it.

    Pauley

  6. #6
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    @Pauley

    Yeah the thing is ITS WEIRD wahaha.. When I started filtering some records are automatically hidden. The workaround that I did is every time I will filter the table I will convert it to range and if I will enter a new record I switch it back to table but thanks for looking into it.

  7. #7
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    I don't know why, but your NO column seems to be causing the issue. When I copy/pasted your table without that column, the filtering worked as expected. When I then added that column to the table, with that same SUBTOTAL formula, the same odd filtering was observed. Nice trick, trying to keep the NO tied to the line number of the displayed table, but Excel does not seem to like it. It appears you also determined this is what was causing the issue since you title calls out that equation.

    If I use a different formula (which does not meet your goal), like =ROW()-1, then the filtering works with one caveat. If some erroneous rows had been shown previously (i.e. the 11/1/12 dates) in a filter, then I change the formula, then those rows continue to show up when filtered. I have to 'reset' the table to make them be properly filtered again.

    Been trying to think of a substitute to the SUBTOTAL formula, but nothing comes to mind. This seems to be an Excel bug.

  8. #8
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    @Pauleyb

    Can I sue Microsoft for this bug? kidding aside.. Yeah seems this is a bug using the very convenient formula for auto numbering. btw thanks for dropping by.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    I got it to work properly by...

    1. Moving column A out of the filtered area. In other words, don't apply the filter to column A.

    2. Converting the table to a normal range and then applying autofilter to the range.
    Last edited by Tony Valko; 01-22-2013 at 11:52 AM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    I was able to reapply the table to the range B1:M468 and it continued to work properly.

  11. #11
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    @Tony

    Yeah.. I already used the #2 workaround but thanks for your time.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to fix formula "=subtotal(3,B$2:B2)"

    Good deal. Thanks for the feedback!

+ 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