+ Reply to Thread
Results 1 to 5 of 5

Apply formula only to visible cells after filtering

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Apply formula only to visible cells after filtering

    Hi,

    How to apply formula only to the cells visible after filtering?
    For eg : My sheet has 3 columns. Column A contains alphabets, Column B contains Words and column C blank (to be filled with data using formula). I use filter to select rows with column A = alphabet A and column B with word 'excel'. Assuming the rows 2,3,5,10,11 are visible. I hardcode a value 1 to C2. I need to fill 10(which is value of C2 i.e 1, + 9) to C3, 19 (value of C3 i.e 10, + 9) to C5, 28 (19 + 9) to C10, 37(28 + 9) to C11. Basically, my question is how to apply formula to only visible cells in column C?
    Or
    is there any other way to do this?

    Thanks in advance.!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Apply formula only to visible cells after filtering

    After filtering, put 1 in C2, and then put this formula in the next visible cell in column C (C3 in your example):

    =MAX(C$1:C2)+9

    Then you can copy that formula into the other visible cells in column C - it will only be put into the visible cells.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-28-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Apply formula only to visible cells after filtering

    Thanks Pete,
    It helped to solve it.

    But if my visible rows are like this - 2, 5, 10, 11 (3 is not visiblen now), how should I change the formula which is to be included in C5 now?

    Also if I need to leave C2 as it is, hardcode the value 1 to C5 and include a formula to fill data for the rest i.e. C10, C11, what should be the modifications?

    Thanks in advance.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Apply formula only to visible cells after filtering

    You put 1 in the first visible cell (let's say C5). Then in the next visible cell (say C10) you would enter this formula:

    =MAX(C$1:C9)+9

    and then copy that down. Note that the range is to the cell above it (which in this case is hidden by the filter).

    You must ensure that column C is empty before applying the filter (i.e. no other values left over from previous filters).

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    09-28-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Apply formula only to visible cells after filtering

    Dear Pete,

    yes. It helped.

    Thanks a lot.!

+ 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