+ Reply to Thread
Results 1 to 6 of 6

Formula to compare to 2 other values

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

    Formula to compare to 2 other values

    I will be collecting data which is in power of twos (2, 4, 8, 16, 32, etc). At some point in the collection, it will center around two numbers (e.g. 16 and 32). So, if I do a Countif, these two numbers would account for 99.9%. I want to flag via a conditional formatting formula, any value higher or lower than these two numbers. Any thoughts? Thanks

    ChemistB

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    You could use this formula in conditional formatting (assuming cell A1):

    =OR(A1<16,A1>32)

    HTH

    Jason

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

    But, I don't know what the two numbers will be when I set up these templates. The first 8 numbers might be 16, then it alternates 8, 16 4 times, then a 4 or a 32 shows up. The 4 or 32 should be highlighted. Eventually however, it might turn out the two most frequent numbers are 4 and 8 as more data is added, then the 16's and 32's should highlight.

    ChemistB

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,913
    Use cell references instead of constants then: =Or(A1<$D$1,A1>$E$1) where D1 and E1 contain the "boundaries." If you want, you should be able to come up with worksheet formula in D1 and E1 that will automatically calculate the boundaries.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Okay, I came up with a solution using RANK, MATCH, COUNTIF and INDEX (not to mention MAX) but there has to be an easier way. In addition, this way wouldn't work if the frequency of the first two numbers is the same.

    Attached is my workbook. Any way to simplify it?

    Thanks
    ChemistB
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    No ideas? :-/

    ChemistB

+ 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