+ Reply to Thread
Results 1 to 5 of 5

Insert data in col d from either a or b depending on value in c

  1. #1
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Insert data in col d from either a or b depending on value in c

    I have columns ABCD.
    A and B contain data
    C contains numbers 0-9 - randomly - sometimes there will be duplicates
    Rules:
    Enter data into D from A until number in C=4 (trigger value)
    AFTER this point, begin inserting data from B
    When data in C=5 (trigger value), AFTER this point, begin inserting data from A again.
    Example follows. NB Data between trigger values will continue to be taken from either A or B until the next trigger.
    Many thanks.

    A AA 7 A
    B BB 2 B
    C CC 5 C
    D DD 5 D
    E EE 6 E
    F FF 5 F
    G GG 4 G
    H HH 4 HH
    I II 3 II
    J JJ 2 JJ
    K KK 6 KK
    L LL 2 LL
    M MM 3 MM
    N NN 3 NN
    O OO 4 OO
    P PP 5 PP
    Q QQ 5 Q
    R RR 5 R
    S SS 4 S
    T TT 7 TT
    U UU 6 UU
    V VV 5 VV
    W WW 4 W
    X XX 3 X

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Insert data in col d from either a or b depending on value in c

    According to your rule then always take value from A unless column C=4 (when it will use B)?

  3. #3
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: Insert data in col d from either a or b depending on value in c

    Values are taken from A until C=4, then we begin to take values from B until C=5 and so forth, switching between columns. So the data between the trigger points will come from one or other column. Not as easy as it looks!
    Last edited by Supersadie; 03-19-2018 at 05:55 AM.

  4. #4
    Registered User
    Join Date
    10-16-2012
    Location
    Woking, England
    MS-Off Ver
    Excel 2003-16
    Posts
    5

    Re: Insert data in col d from either a or b depending on value in c

    The below should work;

    Please Login or Register  to view this content.
    =TRIM(REPT(B1,(C1=4))&REPT(A1,(C1>=5))&REPT(A1,(C1<4)))
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: Insert data in col d from either a or b depending on value in c

    Thanks for the thought. Only partially successful - it's the cell AFTER the trigger that changes columns so the cell itself should be consistent with the ones before it. Hope that makes sense.

+ 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. Insert data from column A or B depending on whether a value exists in C
    By Supersadie in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 03-15-2018, 06:56 AM
  2. Insert Vlookup Depending On Certain Conditions
    By TkdKidSnake in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2014, 06:14 PM
  3. Insert formula depending on cells depending of variables
    By elmexicano87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2014, 01:22 PM
  4. Insert data depending on text string
    By thylander in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2011, 10:19 AM
  5. testing data, insert formula depending on data length
    By davidparkes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-02-2011, 06:22 PM
  6. Insert Row Depending on Cell Value
    By BazzaBoy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-03-2010, 10:35 PM
  7. [SOLVED] How do i insert lines into a worksheet depending on if data exist.
    By Nutter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2005, 12:06 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