+ Reply to Thread
Results 1 to 11 of 11

I need the first 4 letters from a cell and i need to put a count at the end of each

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    canada
    MS-Off Ver
    Excel 365 (Mac)
    Posts
    26

    I need the first 4 letters from a cell and i need to put a count at the end of each

    I Need to pull the first 4 letters from a cell, whilst not including characters like "&" symbols and spaces, numbers in the middle or end of the 4 is acceptable

    and then i need them to be counted and the count displayed as such GGTF-1, GGTF-2 , .......... so on so on......

    and the count is only of the set of 4 letters that are the same, eg if the GGTF turned into anything else even GGTG then a new count should start


    please review my uploaded photo it will make it abundantly clear

    thank you

    i need this bad otherwise i must type 11,000 cells by hand!!
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    =left(d283,4) and drag down.

    After that make an pivot table of it.

    Anoter option would be using countif.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    canada
    MS-Off Ver
    Excel 365 (Mac)
    Posts
    26

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    what is a pivot table?

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    Excel 2007 => insert => pivot table.

    But if you don't know this option, maybe (for now) stick on the countif formula.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    assuming data starts at row 2 try this formula copied down

    =LEFT(E2,4)&TEXT(COUNTIF(E$2:E2,LEFT(E2,4)&"*"),"00")
    Audere est facere

  6. #6
    Registered User
    Join Date
    06-18-2013
    Location
    canada
    MS-Off Ver
    Excel 365 (Mac)
    Posts
    26

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    its working except its not deleting the spaces that are present, plus i need a dash (-) before the ending number, but its so close

    Oh and it must not accept (&) symbols


    what do i change please please
    Last edited by nate02167; 06-20-2013 at 10:19 AM.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    OK that makes it a little trickier - try this version

    =LEFT(SUBSTITUTE(SUBSTITUTE(E2," ",""),"&",""),4)&TEXT(SUMPRODUCT((LEFT(SUBSTITUTE(SUBSTITUTE(E$2:E2," ",""),"&",""),4)=LEFT(SUBSTITUTE(SUBSTITUTE(E2," ",""),"&",""),4))+0),"-00")

  8. #8
    Registered User
    Join Date
    06-18-2013
    Location
    canada
    MS-Off Ver
    Excel 365 (Mac)
    Posts
    26

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    wow your good, its working about 95 percent now, its not removing , and -

    is that fixable? if not il just make the little changes manually later

    thanks tho i just completed 5,000 cells in 1 minute haha

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    SUBSTITUTE removes the unwanted characters but unfortunately you need to "nest" another SUBSTITUTE function for each character (and in 3 places) so to amend my version to ignore dashes amend like this

    =LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E2," ",""),"&",""),"-",""),4)&TEXT(SUMPRODUCT((LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E$2:E2," ",""),"&",""),"-",""),4)=LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E2," ",""),"&",""),"-",""),4))+0),"-00")

    add more SUBSTITUTE functions as required to remove more characters

  10. #10
    Registered User
    Join Date
    06-18-2013
    Location
    canada
    MS-Off Ver
    Excel 365 (Mac)
    Posts
    26

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    can you put the period in too i just dont wanna mess it up, im a newb :S


    please and then its perfect!!!

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: I need the first 4 letters from a cell and i need to put a count at the end of each

    Try this version

    =LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E2," ",""),"&",""),"-",""),".",""),4)&TEXT(SUMPRODUCT((LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E$2:E2," ",""),"&",""),"-",""),".",""),4)=LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E2," ",""),"&",""),"-",""),".",""),4))+0),"-00")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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