+ Reply to Thread
Results 1 to 11 of 11

Formula To Create A Dynamic Title While Using Filters

Hybrid View

  1. #1
    Registered User
    Join Date
    01-08-2013
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    21

    Formula To Create A Dynamic Title While Using Filters

    Hello,

    I have a table, with filters. When I filter to something, I would like to have another cell automatically update with the name of what has been filtered. I have included an example of what I am trying to create. Hope this makes sense. Thanks.
    Attached Files Attached Files
    Regards, Charms

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula To Create A Dynamic Title While Using Filters

    Hi,

    Try this array (important) formula:

    =INDEX($B$4:$B$26,SMALL(IF(SUBTOTAL(3,OFFSET($B$4,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26)),,,))>0,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26))+1),1))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    01-08-2013
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Formula To Create A Dynamic Title While Using Filters

    Quote Originally Posted by XOR LX View Post
    Hi,

    Try this array (important) formula:

    =INDEX($B$4:$B$26,SMALL(IF(SUBTOTAL(3,OFFSET($B$4,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26)),,,))>0,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26))+1),1))

    Regards
    When I put that formula into cell H3 of the initial file I included, it doesn't seem to work when i filter to another type of fruit. If I don't filter to anything the formula brings back "Apples".

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula To Create A Dynamic Title While Using Filters

    And I trust you didn't miss the underlined, emboldened part about entering this as an array formula?

    Worked fine for me.

    Regards

  5. #5
    Registered User
    Join Date
    01-08-2013
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Formula To Create A Dynamic Title While Using Filters

    Oh you're right. I'm sorry I forgot the special way to enter the formula. It works perfectly now! Thanks!

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula To Create A Dynamic Title While Using Filters

    You're welcome.

  7. #7
    Registered User
    Join Date
    01-08-2013
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Formula To Create A Dynamic Title While Using Filters

    I'm sorry, there is one more thing I forgot to look for. Is there a way to add to the formula that if nothing is being filtered cell H3 will say "Combined"?

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula To Create A Dynamic Title While Using Filters

    Actually, that first part can be a lot simpler:

    =IF(SUBTOTAL(3,$B$4:$B$26)=ROWS($B$4:$B$26),"Combined",INDEX($B$4:$B$26,SMALL(IF(SUBTOTAL(3,OFFSET($B$4,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26)),,,))>0,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26))+1),1)))

    Regards

  9. #9
    Registered User
    Join Date
    01-08-2013
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Formula To Create A Dynamic Title While Using Filters

    That fixes it! Thanks again!

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula To Create A Dynamic Title While Using Filters

    Sorry, you did mention that in your attachment. Again, array-entered:

    =IF(SUM(SUBTOTAL(3,OFFSET($B$4,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26)),,,)))=ROWS($B$4:$B$26),"Combined",INDEX($B$4:$B$26,SMALL(IF(SUBTOTAL(3,OFFSET($B$4,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26)),,,))>0,ROW($B$4:$B$26)-MIN(ROW($B$4:$B$26))+1),1)))

    Regards

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula To Create A Dynamic Title While Using Filters

    You're welcome again!

+ 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. Having a title appear based on filters
    By szm187 in forum Excel General
    Replies: 6
    Last Post: 03-27-2012, 04:27 PM
  2. Replies: 15
    Last Post: 01-25-2012, 02:05 PM
  3. Create Dynamic Formula
    By mbsmeltzer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2011, 07:21 PM
  4. Trying to create a dynamic formula in VBA.
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2008, 07:26 PM
  5. [SOLVED] How to create a 'dynamic' formula?
    By Bill in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-22-2006, 02:25 PM

Tags for this Thread

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