+ Reply to Thread
Results 1 to 5 of 5

Custom filter to select a value and values divisible by that number.

  1. #1
    Forum Contributor
    Join Date
    12-15-2008
    Location
    Oxfordshire, UK
    MS-Off Ver
    2007.
    Posts
    100

    Custom filter to select a value and values divisible by that number.

    Hi all,

    As I have not tried to do this yet this is a hypothetical scenario.
    Imagine that a column, when filtered, gives cell values such as 3,6,9,12,18,24,36 ..and so on. Is there a way to select, say 12, and then see all the other values that are divisible into 12. e.g. all rows that have 3,6,12. Another example- select 36 and see 3,6,9,12,18 and 36?

    On the attached example sheet, column 'O' will be filtered.

    Apologies for not trying to crack this myself but I do not know where to begin.

    One more little question, will macros still run in hidden columns?

    Many thanks.

    JD
    Attached Files Attached Files
    Last edited by jad70; 02-14-2009 at 05:22 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Custom filter to select a value and values divisible by that number.

    Hi

    How about adding a "helper" column and filtering on that. Using your example file, put .5 in U1. In U2 enter the formula
    =MOD(O2,$U$1)=0
    and copy it down to U817. Now if you put on an autofilter, you can filter on TRUE in column U.

    Does that give you some ideas?


    rylo

  3. #3
    Forum Contributor
    Join Date
    12-15-2008
    Location
    Oxfordshire, UK
    MS-Off Ver
    2007.
    Posts
    100

    Re: Custom filter to select a value and values divisible by that number.

    rylo,

    Thanks for the input.
    I made a slight mistake on my original post, it is column called 'Due Cal' that needs to be filtered. (row 'N')
    I altered your formula to reflect this, then in U1 put in 12. After about 5 minutes, it finally filters all results above 12 but divisible by 12, whereas I want the opposite. If I put in 12, I want to view the row results for 3,6 and 12.
    If I can do this simply with a modification of the formula, then perhaps I do not need a macro to run this as I will be selecting the value of U1 from a drop down cell (showing all the filter values) on another sheet. All the user has to do is select a value, say 144, and the 'All Tasks' sheet will display all the tasks for 144 and values divisible into 144.

    I will try and play with the formula, but any advice would be great.

    Cheers.

    JD

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Custom filter to select a value and values divisible by that number.

    Hi

    Try this

    U2:
    =AND(N2<=$U$1,MOD($U$1,N2)=0)
    rylo

  5. #5
    Forum Contributor
    Join Date
    12-15-2008
    Location
    Oxfordshire, UK
    MS-Off Ver
    2007.
    Posts
    100

    Re: Custom filter to select a value and values divisible by that number.

    rylo,

    apologies for the delay.

    Your format works a treat. If I select 144 it shows me all the factors of 144 and I just filter for true.

    Many thanks.

+ 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