+ Reply to Thread
Results 1 to 9 of 9

Formula for repetitive data per row

  1. #1
    Registered User
    Join Date
    08-11-2009
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    7

    Formula for repetitive data per row

    Hello,
    I'm looking for a formula in column G that returns YES or NO when YES is repeated more than once in columns A to F, but the previous and next columns are NO, as described in rows 2 and 4 in the example.
    Thanks in advance!
    Be healthy!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula for repetitive data per row

    I do not understand what you are asking from the sample file can you try to explain more?

  3. #3
    Registered User
    Join Date
    08-11-2009
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula for repetitive data per row

    If in columns 1 to 6 YES is repeated more than once and if before and after YES there is NO the expected result is YES otherwise it is NO.
    or
    If before and after NO there is YES the expected result is YES otherwise it is NO.
    I supplemented the example with two new lines.
    Attached Files Attached Files

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula for repetitive data per row

    Please try

    =IF(COUNT(FIND({12,21},NPV(9,1+(A2:F2="NO"))))=2,"YES","NO")
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula for repetitive data per row

    why is row 9 yes? when there is not a no before and after? I have to confess the formula is beyond me and a very clever solution, which I will have to sit down and work out!

  6. #6
    Registered User
    Join Date
    08-11-2009
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula for repetitive data per row

    Look above:
    "or
    If before and after NO there is YES the expected result is YES otherwise it is NO."
    Thank you!
    I need one report, the columns are the twelve months, but the principle for the other 6 is the same.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Formula for repetitive data per row

    Try in G2:

    Please Login or Register  to view this content.
    Quang PT

  8. #8
    Registered User
    Join Date
    08-11-2009
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula for repetitive data per row

    Thank you so much!
    Only one equal (=) after the greater (>) and it works perfectly.
    IF(COUNT(SEARCH({"NOYESNO","YESNOYES"},A2&B2&C2&D2&E2&F2))>=1,"YES","NO")
    Be healthy!

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula for repetitive data per row

    Quote Originally Posted by davsth View Post
    why is row 9 yes? when there is not a no before and after? I have to confess the formula is beyond me and a very clever solution, which I will have to sit down and work out!
    @davsth Thanks for kind comment and the reps

    Before I came up with
    =IF(COUNT(FIND({12,21},NPV(9,1+(A2:F2="NO"))))=2,"YES","NO")
    I used
    =IF(COUNT(SEARCH({"OY","SN"},A2&B2&C2&D2&E2&F2))=2,"YES","NO")

    But if we want to expand to more column like A:Z then we need to add 25 more & ampersand which is not fun
    for MS 365 we can use Concat(A2:Z2) but other vesion don't have this.

    NPV trick to concat number, I learn from XOR LX
    https://www.excelforum.com/excel-for...ml#post5378511
    I have Thai Clip to explain NPV
    https://youtu.be/dbTH590_RDg


    1+(A2:F2="NO") Change Yes to 1 and NO to 2
    We can concat number from A:Z using just

    NPV(9,1+(A2:Z2="NO")))

    instead of

    A2&B2&C2&D2&E2&F2…&Y2&Z2

    Then find 12 for YesNO and 21 for NoYes
    Last edited by Bo_Ry; 09-11-2020 at 08:44 AM.

+ 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] Expanding a repetitive formula that follows a pattern
    By crone133 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2019, 05:55 AM
  2. Formula for repetitive code
    By vikixp2003 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-26-2019, 09:36 AM
  3. Replies: 22
    Last Post: 03-16-2019, 04:22 AM
  4. Too much repetitive data
    By jwheeler388 in forum Excel General
    Replies: 4
    Last Post: 08-06-2016, 08:17 AM
  5. Replies: 7
    Last Post: 08-26-2015, 12:19 PM
  6. [SOLVED] Repetitive Formula
    By ayokas in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-07-2015, 12:56 PM
  7. Repetitive sheet references in formula
    By eugbed in forum Excel General
    Replies: 3
    Last Post: 05-01-2010, 12:33 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