+ Reply to Thread
Results 1 to 4 of 4

Creating a Flag based on cell value

Hybrid View

Guest Creating a Flag based on cell... 05-04-2006, 02:15 PM
Guest Re: Creating a Flag based on... 05-04-2006, 02:40 PM
Guest Re: Creating a Flag based on... 05-04-2006, 02:55 PM
Guest Re: Creating a Flag based on... 05-04-2006, 03:50 PM
  1. #1
    Dan G.
    Guest

    Creating a Flag based on cell value

    Hello. I'm trying to create a Function based on the cell values within a
    range to create a flag (1 - on or 0 - off) in another.

    The problem is the same value when it repeats has to have a different
    flag value. For example

    Range-x Range--y
    Key -----> 1
    Hello -------> 1
    Bye --------> 1
    Key --------> 0
    Yes --------> 0
    No ---------> 0
    Key --------> 1
    This --------> 1
    That --------> 1
    Key --------> 0
    Fix --------> 0

    So the flag needs to alternate designation off of a particular value
    when it appears in the range and alternate in groups.

    When it first appears, everything underneath it is a "1". When it
    appears again as a trigger, everything underneath it is a "0" until it
    appears again, and so on. I hope this makes sense.

    Any help here would be greatly appreciated.

    Thanks

    Dan

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Brian Taylor
    Guest

    Re: Creating a Flag based on cell value

    You shouldn't need a UDF for that. Try this formula and drag down:

    =IF(MOD(SUM(($A$5:A5="Key")*1),2)=1,"Yes","No")

    It is an array formula so be sure to use ctrl shift enter.


  3. #3
    Tom Ogilvy
    Guest

    Re: Creating a Flag based on cell value

    in cell Y1
    =MOD(COUNTIF($X$1:X1,"Key"),2)

    then drag fill down the column

    would also work.

    --
    Regards,
    Tom Ogilvy

    "Brian Taylor" wrote:

    > You shouldn't need a UDF for that. Try this formula and drag down:
    >
    > =IF(MOD(SUM(($A$5:A5="Key")*1),2)=1,"Yes","No")
    >
    > It is an array formula so be sure to use ctrl shift enter.
    >
    >


  4. #4
    Brian Taylor
    Guest

    Re: Creating a Flag based on cell value

    I've been out done! Nicely done Tom. I guess I get stuck on array
    formulas sometimes. Better to avoid them if you can.


+ 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