+ Reply to Thread
Results 1 to 6 of 6

Autofill with same pattern

  1. #1
    Registered User
    Join Date
    09-30-2020
    Location
    Bath, England
    MS-Off Ver
    Excel 2016
    Posts
    17

    Autofill with same pattern

    Is there a way to autofill a formula using COUNTIF (or maybe other variables) which has the same text on Excel 2016?

    For example if I have the data in below rows:
    John Smith
    Dave Brown
    Mark Jones

    And I want to search in a range for those I could put =COUNTIF(A:A, "Smith")
    In the row below I would want to put =COUNTIF(A:A "Brown")

    If I use autofill it would just fill it all in with Smith. Is there any way it can copy the rule from above? i.e. keep the cells the same but recognise to change the word in quotes. At the moment I just autofill and overtype each word in quotes which can take a while.

    Happy to post an example if needed, which it probably will be! As I said at the start I think I've seen it before when it highlights it in grey?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Autofill with same pattern

    Use a formula like this in B1:

    =IF(COUNTIF(A$1:A1,A1)=1,COUNTIF(A:A,A1),"")

    then copy down. It will give a count of the name in column A only on the row where the name is encountered for the first time.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-30-2020
    Location
    Bath, England
    MS-Off Ver
    Excel 2016
    Posts
    17

    Re: Autofill with same pattern

    Definitely on the right lines. I've attached an example which might help more as it shows the names are in different columns, and the key has their first and surnames in, rather than just surname.
    Attached Files Attached Files

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

    Re: Autofill with same pattern

    Try this which is suitable

    =IFERROR(SUMPRODUCT(--($A$1:$A$15=RIGHT(M2,LEN(M2)-FIND(" ",M2)))),"")


    =IFERROR(SUMPRODUCT(--(INDEX($A$1:$K$15,,ROWS($O$2:$O2))=RIGHT(M2,LEN(M2)-FIND(" ",M2)))),"")
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Autofill with same pattern

    I think you need to explain your attachment a bit more. What do the columns represent? The first 3 columns have the same name copied down but other columns have two or more names in them, some of which seem to spill from one column to the next. What is the purpose of the arrow-down symbol at the end of some of the names? What are you trying to achieve here?

    Pete

  6. #6
    Registered User
    Join Date
    09-30-2020
    Location
    Bath, England
    MS-Off Ver
    Excel 2016
    Posts
    17

    Re: Autofill with same pattern

    The columns are football team line-ups in order, so it's 1-11.

    The arrows indicate that the player was substituted. I used it because when I do COUNTIF I end up with the formula =COUNTIF(A:K, "Porter↓"). If a player starts I have: =COUNTIF(A:K, "*Porter*") so it picks up whether it has an arrow next to its name.

    Therefore the formulas sent work perfectly for the players that start which is brilliant, but it hasn't collected the info for those that are substituted.

    i.e. if the list says:
    Porter
    Porter
    Porter↓
    Porter
    Porter

    For starts with the formula it would read 4 instead of 5, when it should be 5.

    The main thing I'm trying to achieve is using autofill where I don't have to copy and paste about 30 different names! So it's not a life-changer but quite handy.

+ 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. Autofill not following formula pattern
    By Whereisthecat? in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2021, 12:02 PM
  2. Autofill Pattern
    By amedeo in forum Excel General
    Replies: 2
    Last Post: 06-22-2015, 08:36 PM
  3. [SOLVED] Autofill not recognizing pattern
    By WILLPOU in forum Excel General
    Replies: 4
    Last Post: 11-05-2013, 11:24 PM
  4. [SOLVED] Autofill not following pattern of the cells.
    By jgcramer in forum Excel General
    Replies: 3
    Last Post: 05-14-2013, 12:55 AM
  5. Autofill a pattern or repeating sequence
    By awcwa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 12:04 PM
  6. [SOLVED] Autofill reference pattern
    By kbka in forum Excel General
    Replies: 2
    Last Post: 06-06-2012, 04:58 AM
  7. autofill cells without a pattern?
    By ryu in forum Excel General
    Replies: 2
    Last Post: 04-11-2005, 09:06 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