+ Reply to Thread
Results 1 to 2 of 2

Need to Loop and return a value based upon data condition

  1. #1
    Registered User
    Join Date
    08-23-2007
    Posts
    24

    Need to Loop and return a value based upon data condition

    A1 = Parent
    B1 = Child
    C1 = Status

    Dataset:

    ITEMA ITEMB OKAY
    ITEMA ITEMC SHORT
    ITEMA ITEMD OKAY
    ITEMG ITEMF OKAY
    ITEMG ITEMA OKAY
    ITEMR ITEMP SHORT
    ITEMR ITEMQ SHORT

    I need to populate column D with the following logic - Loop Column A - find the 3 rows labeled ITEMA (they will always be grouped together) - if all column C = 'OKAY' then populate a new column with 'Good' or if any of the three rows have a 'SHORT' then return 'Not Good'.......then go to the next group and repeat, etc......

    In the following dataset the result would be:

    ITEMA ITEMB OKAY Not Good
    ITEMA ITEMC SHORT Not Good
    ITEMA ITEMD OKAY Not Good
    ITEMG ITEMF OKAY Good
    ITEMG ITEMA OKAY Good
    ITEMR ITEMP SHORT Not Good
    ITEMR ITEMQ SHORT Not Good

    Any suggestions would be appreciated...........

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Need to Loop and return a value based upon data condition

    Hi,
    No need of VBA.
    Try this formula in D1 and copy down. (Adapt range as required)

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

+ 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. [SOLVED] Help Edit Loop that deletes Rows based on Date condition.
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2015, 02:16 PM
  2. [SOLVED] Insert chart series label based on condition using for each - next loop
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2014, 09:34 AM
  3. Return a value based on a condition
    By uberathlete in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-08-2013, 08:58 PM
  4. Copy/Paste based on encountered condition within a loop
    By msmick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2011, 06:37 PM
  5. Loop and Trim based on condition
    By SWMagic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-26-2010, 02:40 AM
  6. condition based deletion - using loop
    By webbug08 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2009, 07:36 PM
  7. A loop to delete rows based on condition
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2007, 05:51 PM

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