+ Reply to Thread
Results 1 to 8 of 8

Flag each group in col C if one or more flag in col A

  1. #1
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Flag each group in col C if one or more flag in col A

    Hi,

    Ideally I'm looking for a way to do this with formula's but for the life of me I just can't think of one. Attached is a sample that explains what I'm trying to achieve.

    Any offers?

    Cheers
    Last edited by oldchippy; 10-16-2008 at 06:28 PM.
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try...

    C2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

    =IF(B2<>"",IF(SUM(IF($B$2:$B$19=B2,IF(ISTEXT($A$2:$A$19),IF($A$2:$A$19="Y",1)))),"Y",""),"")

    Hope this helps!

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Well Domenic, thanks very much, thats brilliant - 10/10

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    You're very welcome! Glad I could help!

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    May be you could help a little more, I've been trying to get my head around how this works - could you explain?

  6. #6
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    For the formula in C2, the SUM part of the formula counts the number of times a value in Column B equals B2, and where the corresponding value in Column A is a text value and equals "Y".

    If SUM returns any number, other than 0, the second IF statement is evaluated as TRUE and "Y" is returned. If SUM returns 0, the second IF statement is evaluated as FALSE and a null string is returned.

    The first IF statement is included so that the second IF statement does not have to be evaluated for any row where the corresponding cell in Column B is empty. For these cases, a null string is returned.

    When the formula is copied to the next cell below, the same process takes place. The difference being that =B2 changes to =B3. And so on as the formula is copied to each cell below.

    Hope this helps!

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523
    Hi oldchippy,

    Though I can see Domenic has provided you the solution (and a very clever one at that) here's my attempt:

    Please Login or Register  to view this content.
    I had to resort to code to cater for the dynamic ranges but then simply used the COUNTIF function. Just ensure the cursor is at the first output cell (C2, D2...) and then run the macro.

    HTH

    Robert
    Last edited by Trebor76; 10-16-2008 at 08:08 PM.

  8. #8
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Thanks Domenic again for explaining the formula and thanks to Trebor76 for the macro that also works - appreciate your help both

+ 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. Calling a textbox in a group
    By stormtroppers in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2008, 02:02 PM
  2. automatic column fill Question
    By mpolox in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-08-2008, 10:28 AM
  3. Massive Sorting question.
    By Rgaherty in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 11-07-2007, 02:15 PM
  4. Number combinations
    By MC82 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2007, 09:04 PM
  5. database to group
    By mhax in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-16-2007, 09:21 AM

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