+ Reply to Thread
Results 1 to 5 of 5

Modify a column of data with a logic argument, copy paste down etc..

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Modify a column of data with a logic argument, copy paste down etc..

    Hi,

    There is an example attached, please look.....0

    Ref in column A with duplicates, Number in column B unique for each ref, there cannot be any line that has the same number for both.

    Further along there is a value but it is currently filled in only once for each ref where it is filled in at all, and will be against the one with the lowest number in column B.

    All I want to do is make a formula to copy and paste down the list next to it to fill in the same value for the rest of a given ref if there is already a value against it. I have done this already in my example where there are only 2 of a given ref and it works fine for that. Unfortunately there are a few that occur more than twice and I am struggling to work out how to do this.

    Imagine the real list is huge and the idea is to copy and paste the formula all the way to the bottom and then copy and paste the values over the top of the original column to amend and fill in the missing values.

    The list can be sorted so that each ref is in order by number, lowest to highest, the value in the value column will always be against the lowest number for each ref.

    Many thanks for any help.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Modify a column of data with a logic argument, copy paste down etc..

    This Arrayed formula will work. In H2 copied down (assumes a maximum of 4 duplicates)

    =IF(F2>0, F2, INDEX(F2:F5, MATCH(1, 1/(F2:F5>0),0)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Modify a column of data with a logic argument, copy paste down etc..

    Hi there,

    Thanks for trying to help me, this is not quite what I mean, there are also refs that are unique with no value against them, those should remain as they are, even if 0, like in my example. The only ones I am missing are the ones near the bottom where there is more than one duplicate of the same ref.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Modify a column of data with a logic argument, copy paste down etc..

    ARRAY formulas
    In 2nd row,
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 12-01-2015 at 05:38 AM.

  5. #5
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Modify a column of data with a logic argument, copy paste down etc..

    Yep works perfectly, many thanks for your help

+ 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 modify existing Copy-Paste code
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2014, 10:03 AM
  2. Adding If / Then Logic to a Copy / Paste VBA Macro
    By levitt in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-06-2014, 01:29 AM
  3. [SOLVED] Please modify my VBA, I want copy paste in next sheet
    By vengatvj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:56 PM
  4. [SOLVED] Please help me to modify the code copy/paste/transpose
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-30-2013, 09:44 AM
  5. Macro for copy/paste using date as argument
    By dellennon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2012, 03:21 AM
  6. VBA code for copy/paste logic needed
    By overlook1977 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2008, 10:20 PM
  7. [SOLVED] Simple Copy-Paste logic not working
    By Brian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2005, 02:40 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