+ Reply to Thread
Results 1 to 8 of 8

Formula auto fill for sequence problem

Hybrid View

  1. #1
    Registered User
    Join Date
    09-21-2018
    Location
    Poland
    MS-Off Ver
    2017
    Posts
    18

    Formula auto fill for sequence problem

    Hello guys,

    Having problem for solving formula problem for AF row with - OK
    If "TAK" appears in one number order - mark everything in this order as "OK"
    If "NIE" appears in whole number order - mark everything in this order as "-"

    For now I came with =IF(OR(AND(W1+1=W2;AF2="OK");(S1="TAK"));"OK";"-") but this doesn't mark as OK numbers below in the same order.

    I have something like this:

    (S) (W) (AF)
    NIE 1 OK
    NIE 2 OK
    TAK 3 OK
    NIE 4 -
    NIE 5 -
    NIE 1 -
    NIE 2 -
    TAK 1 OK
    NIE 2 -
    NIE 1 OK
    TAK 2 OK
    NIE 1 -
    TAK 1 OK

    I need something like this:

    (S) (W) (AF)
    NIE 1 OK
    NIE 2 OK
    TAK 3 OK
    NIE 4 OK
    NIE 5 OK
    NIE 1 -
    NIE 2 -
    TAK 1 OK
    NIE 2 OK
    NIE 1 OK
    TAK 2 OK
    NIE 1 -
    TAK 1 OK

    Can anyone help me with this case?
    Thank you!
    Last edited by Calios; 09-27-2018 at 06:37 AM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula problem

    Your requirement is not clear, perhaps this in AF2 and fill down.

    Note that the data needs to start in row 2 for this to work, the parts of the formula that refer to row 1 need to look above the first row of data.

    =IF(S2="TAK";"OK";IF(COUNTIFS(S$1:S1;"NIE";W$1:W1;W2);"-";"OK"))

  3. #3
    Registered User
    Join Date
    09-21-2018
    Location
    Poland
    MS-Off Ver
    2017
    Posts
    18

    Re: Formula problem

    Jason - unfortunately it doesn't work as intendent.

    I need to fill cells in AF column with "OK" if in one number sequence for example from 1-6 one cell for example 3 is "TAK". Whole sequence from 1-6 should be filled with "OK".

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,682

    Re: Formula problem

    Thank you for the title change!
    Last edited by Sam Capricci; 09-27-2018 at 06:41 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    09-21-2018
    Location
    Poland
    MS-Off Ver
    2017
    Posts
    18

    Re: Formula problem

    Quote Originally Posted by Sambo kid View Post
    Would you please change your post title per forum rule #1.
    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this request is fulfilled, as per Forum Rule 6)
    Title changed - thanks.

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,682

    Re: Formula auto fill for sequence problem

    If "NIE" appears in whole number order - mark everything in this order as "-"
    could you explain how the formula would differentiate between the first set of NIE (1 and 2, then 4 and 5) and are "OK" from the second NIE 1 and 2 and are "-".
    and what makes the third set of NIE 2 followed by 1 OK and the last NIE 1 -?

  7. #7
    Registered User
    Join Date
    09-21-2018
    Location
    Poland
    MS-Off Ver
    2017
    Posts
    18

    Re: Formula auto fill for sequence problem

    =IF(OR(AND(W1+1=W2;AF2="OK");(S1="TAK");AND(W1-1=W0;S0="TAK"));"OK";"-")

    This works perfectly if I put TAK in the cell with the highest number in the combination however if i put it lower it doesn't "OK" for higher numbers in the combination :/

    I made a logic diagram and it seems its impossible to do this in one cell - perhaps il do some VBA or split it to two cells.
    Last edited by Calios; 09-27-2018 at 08:51 AM.

  8. #8
    Registered User
    Join Date
    09-21-2018
    Location
    Poland
    MS-Off Ver
    2017
    Posts
    18

    Re: Formula auto fill for sequence problem

    Please don't bother with column (S) and column (W) - these are my data calculated from different logics.

    3rd set of NIE:

    TAK 1 OK
    NIE 2 OK

    It's ok because numbers are in order (1 then 2 - this time 1 is TAK)

    4th set of NIE:

    NIE 1 OK
    TAK 2 OK

    It's ok because numbers are in order (1 then 2 - this time 2 is TAK)

    5h set of NIE:

    NIE 1 -
    TAK 1 OK

    It's "-" because following number is again 1 not 2 and its "NIE"
    It's "OK" because it's TAK.

+ 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. Data Capturing
    By zas9313 in forum Excel General
    Replies: 1
    Last Post: 11-21-2014, 03:22 AM
  2. Replies: 1
    Last Post: 01-06-2014, 03:54 AM
  3. Replies: 7
    Last Post: 02-03-2013, 06:25 PM
  4. Replies: 2
    Last Post: 01-22-2013, 07:09 AM
  5. Problem reading formula with ActiveCell.Formula
    By Matija in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2011, 06:10 AM
  6. Formula Problem
    By superkopite in forum Excel General
    Replies: 5
    Last Post: 02-21-2006, 09:05 AM
  7. [SOLVED] Formula problem
    By Mike in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM

Tags for this Thread

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