+ Reply to Thread
Results 1 to 12 of 12

Advice on copying cells into second tab

Hybrid View

  1. #1
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Advice on copying cells into second tab

    I presume that it's this bit you need to understand:

    =IFERROR(INDEX(Sheet1!$B$2:$B$55,MATCH(0,INDEX(COUNTIF($B$8:$B8,Sheet1!$B$2:$B$55),0),0)),"")

    the INDEX in the middle of it is just an Excel "trick" to transform an array formula into a non-array (ordinary) formula, which many users prefer. The unadapted formula is:

    =IFERROR(INDEX(Sheet1!$B$2:$B$55,MATCH(0,COUNTIF($B$8:$B8,Sheet1!$B$2:$B$55),0)),"")

    Being an array formula, it would need to be set using CTRL-SHIFT-Enter.

    At its heart is this bit:



    COUNTIF($B$8:$B8,Sheet1!$B$2:$B$55)

    which returns 1 or 0 depending on whether the value in $B$8:$B8 has previously been found in the range $B$2:$B$55. In B9, the value in B8 (a blank cell - but can be a header) will never previously been found in that range, so it returns a series of 0s. The bit in red returns the row corresponding to the first zero. In B9, it will be the first row. The INDEX bit in cyan returns the corresponding value from column B - in this case BD. When the formula is copied into B9, any cells inthe column containing BD will return a 1 in the countif, so the first row that returns a zero in the countif will be passed to the INDEX function, and KR will be returned.

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  2. #2
    Registered User
    Join Date
    03-24-2018
    Location
    england
    MS-Off Ver
    office 365
    Posts
    20

    Re: Advice on copying cells into second tab

    Thanks Glenn, i will have to do some studying on this. i like the way this works and its now working well on my main worksheet.

    i will mark this as solver and add reputation cheers

+ 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. Advice on clearing contents of cells
    By neil40 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2017, 06:42 PM
  2. [SOLVED] Copying Formula Issue Advice - I'm SURE there is an easy answer I am overlooking
    By johnnygirl51 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-09-2017, 11:58 AM
  3. VBA code advice/Excel advice for summing groups of numbers
    By paulblower in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 05:47 AM
  4. [SOLVED] Macro to make copying cells automate,- an appeal for expert's advice!
    By Arty_1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-04-2014, 07:22 AM
  5. [SOLVED] Need advice on how to automate copying one cell into many cells in Excel 2010
    By shelbyjayIII in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2013, 05:48 PM
  6. Multiple copying of a Spreadsheet advice please
    By Dermot in forum Excel General
    Replies: 3
    Last Post: 07-30-2006, 08:37 AM
  7. A little advice on comparing cells
    By systematic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-24-2005, 07:20 AM

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