+ Reply to Thread
Results 1 to 39 of 39

Count different type of text and give me text and sum of numbers

  1. #1
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Count different type of text and give me text and sum of numbers

    List of people with two letter state and I want to count states and the result would be how many states and what states?

    STATE
    Anne NY
    Nina
    Joanna FL
    Gabriela MO
    Linda
    Sigrid NY
    Bella
    Heida
    Sandra
    Eva

    NY 2
    FL 1
    MO 1
    How to get excel to give me this result?
    Attached Files Attached Files
    Last edited by Mariaoskars; 02-16-2022 at 10:58 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    Not at all clear ...

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Sorry for that, You were to quick for me, I was editing it

    Can you help me with that?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    In D14 copied down:

    =COUNTIF($C$3:$C$12,C14)

    You may need to replace the comma with a semi-colon for your Icelandic locale.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Count different type of text and give me text and sum of numbers

    Try

    in D14

    =COUNTIF($C$3:$C$12,$C14)
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Forum Contributor
    Join Date
    03-28-2021
    Location
    China
    MS-Off Ver
    O365
    Posts
    111

    Re: Count different type of text and give me text and sum of numbers

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    And in C14 copied down:

    =IFERROR(INDEX($C$3:$C$12,MATCH(0,IF(ISBLANK($C$3:$C$12),"",COUNTIF(C$13:$C13,$C$3:$C$12)),0)),"")

  8. #8
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    The problem is that I do not have this list in the begining
    NY
    FL
    MO

    but I do have this one which is hidden sheet
    AL
    AK
    AZ
    AR
    AS
    CA
    CO
    CT
    DE
    DC
    FL
    GA
    GU
    HI
    ID
    IL
    IN
    IA
    KS
    KY
    LA
    ME
    MD
    MA
    MI
    MN
    MS
    MO
    MT
    NE
    NV
    NH
    NJ
    NM
    NY
    NC
    ND
    CM
    OH
    OK
    OR
    PA
    PR
    RI
    SC
    SD
    TN
    TX
    TT
    UT
    VT
    VA
    VI
    WA
    WV
    WI
    WY

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    The problem is that I do not have this list in the begining
    NY
    FL
    MO
    See post #7.

    I cannot see how this would relate to a longer list elsewhere.

    I think if you have not got what you want so far (and you really haven't commented on ANY of the solutions offered!), then you need to explain in more detail the wider context of what you are trying to do.

  10. #10
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    How to count the state but the thing is I do not know in advance which state will be in my list
    STATE
    Anne NY
    Nina
    Joanna FL
    Gabriela MO
    Linda
    Sigrid NY
    Bella
    Heida
    Sandra
    Eva

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    It doesn't matter. The formulae I gave you will sort it out for you. See the workbook attached.
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

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

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  13. #13
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Quote Originally Posted by AliGW View Post
    And in C14 copied down:

    =IFERROR(INDEX($C$3:$C$12,MATCH(0,IF(ISBLANK($C$3:$C$12),"",COUNTIF(C$13:$C13,$C$3:$C$12)),0)),"")
    Thank you AliGW I can see that this formula is working in the excel document you sent me.
    Since this formula is a little bit above my understanding I am having difficulties coping it to my mine document and getting it to work there.

    In the document I see there is a { } meaning this is a array so can you please explain how it is best to get this formula to work in a other document
    =IFERROR(INDEX($Y$2:$Y$140;MATCH(0;IF(ISBLANK($Y$2:$Y$140);"";COUNTIF(Y$142:$Y142;$Y$2:$Y$140));0));"") this is the formula I am trying to get to work for me but does not give anything yet
    Also I am wondering why you have in your formula this C$13:$C13 since it is a cell that contains nothing.

    Hope you can help with this

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    You may need to enter the formula as an array formula:

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

    Also I am wondering why you have in your formula this C$13:$C13 since it is a cell that contains nothing.
    It makes the formula count how many times a state has appeared - it makes sure that the list is unique. You really don't need to worry about it that much.

    Hope you can help with this
    Beyond what I have just said, no, not without seeing the new workbook. It could be all sorts of things. Please attach a new version for me to look at for you.

  15. #15
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Ok I know about CTRL+SHIFT+ENTER but what fields are selected in the original document (the excel doc which I gave in the beginning) when you press CTRL+SHIFT+ENTER
    =IFERROR(INDEX($C$3:$C$12,MATCH(0,IF(ISBLANK($C$3:$C$12),"",COUNTIF(C$13:$C13,$C$3:$C$12)),0)),"")

  16. #16
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Count different type of text and give me text and sum of numbers

    if you don't mind to use helper cells.

    E3 (copy to each row)
    =IF(COUNTIF(C$2:C3,C3)=1,E2+1,E2)

    G14 to G18 enter 1,2,3,4,5

    H14
    =IF(G14<=MAX($E$3:$E$12),INDEX($C$3:$C$12,MATCH(G14,$E$3:$E$12,0)),"")

    I14
    =IF($G14<=MAX($E$3:$E$12),COUNTIF($C$3:$C$12,H14),"")

    Regards.
    Attached Files Attached Files

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    Quote Originally Posted by Mariaoskars View Post
    Ok I know about CTRL+SHIFT+ENTER ...
    Just share the new workbook and I will give you a step-by-step. I'm not going to go through all the various things that you might have got wrong when seeing the workbook will show instantly what that is.

  18. #18
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Sorry but the document is in Icelandic and contains confidential information

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    Just desensitise it. I can cope with Icelandic ...

    Copy it - cut out any worksheets that are not relevant. Desensitise anything left that is confidential (e.g. use names like Person1, Person2, etc.). Remove ANYTHING that is not necessary.

    If you make an effort to help me, then I'll make an effort to help you. Sadly, I am not psychic.
    Last edited by AliGW; 02-17-2022 at 09:29 AM.

  20. #20
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    YES!!! It Worked
    Thank you so much <3

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,626

    Re: Count different type of text and give me text and sum of numbers

    Well done!!! So glad you worked it out. Thanks for the kind comment.

  22. #22
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Hi again, I am still having the trouble with the same formula, I thing the formula is right but I do not know how to get it to work
    =IFERROR(INDEX($Y$2:$Y$300;MATCH(0;IF(ISBLANK($Y$2:$Y$300);"";COUNTIF(Y$141:$Y144;$Y$2:$Y$300));0));"")

    I have attaced the document which I have been working on and I would like to have the formula working in two places in sheet 'Jan22 AF' Colum and sheet 'Frístund B2'
    Attached Files Attached Files

  23. #23
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    Seem to be some circular references on both the Jan22 and Frístund sheets which may be causing problems with getting the expected results.
    That said, it may help us understand the issue if we knew the expected results for cells AF2:AF10 on the Jan22 sheet.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  24. #24
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Count different type of text and give me text and sum of numbers

    Please try

    AF2 (follow with Ctrl-Shift-Enter) then copy down.
    =IFERROR(INDEX(Y$2:Y$300,MATCH(0,COUNTIF(AF$1:AF1,Y$2:Y$300),0)),"")

    Regards.

  25. #25
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Thank yo for your reply, I tried your formula and it only gave me zero all the way down the other one worked but some how when I moved it to a different place in the document I did not get it to work right.

  26. #26
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Hi JeteMc
    Thank you for your reply. I think this formula in sheet Frístund in B-column is locked on some info in another document and that is why I am getting circular error.

    What I am trying to do is count the Ixxx number in column Y in sheet Jan22. The first thing is to list them up and then count them. Similar to the one I am trying to sett up in the sheet Fristund. I got this formula here in the chat above and when I moved it to another location sadly it did not work any more.
    =IFERROR(INDEX($Y$2:$Y$300;MATCH(0;IF(ISBLANK($Y$2:$Y$300);"";COUNTIF(Y$141:$Y144;$Y$2:$Y$300));0));"")

  27. #27
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    The message that I see is that the circular reference on the Jan22 sheet is in cell O146 so not column B.
    When I asked for the expected results for cells AF2:AF10 on the Jan22 sheet, I was asking you to tell/show us what should be in each of those cells, not a description of how they should be filled.
    Please either list in your next post, or manually show in an Excel file, what each cell in the range AF2:AF10 should display.

  28. #28
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    What I want to get is a list of workplaces from column Y
    The outcome (if working right) would be in AF2:AF10 - this list:
    Vogasel
    Bakkasel
    Brosbær
    Stjörnuland
    Sólbúar
    Alftabær
    Ösp
    Simbað
    Tónabær

    The workplaces are not always the same so next time they could be different names.
    Then in AG – column I would use a count how often e.g. Vogasel is in Column Y (6 time) but that I can do my self ( I know how)

    Regarding the Circular messages which I get to, the cell O146 in my sheet only contains this =+ROUNDDOWN((idag-D146)/365;0) which is the same/similar to the cells in all the O-column, I can't see what is range with that

  29. #29
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    Paste the following array entered formula** into cell AF2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    After the formula is in cell AF2 is activated, drag the fill handle down to cell AF12.
    Let us know if you have any questions.

  30. #30
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Yess I got this formula to work, Thank you, one more question, what is the best way to get the summary in a special sheet. I only want to get the lines that have a number in sum(AC-column) and also:
    Nr, Name, cost, nr1, Work, sum - cells/columns

    I could use filter or advanced filter but then I would not get an active number only copy paste numbers/text cells with out connections. Do you see a better way? One more thing, next month there will be different people so the document will change meaning that the summery document/sheet has to change according to the new calculation.

    Hope you can help

  31. #31
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    As there are only #VALUE! errors in column AC I am not able to illustrate, however you may be able to use a combination of INDEX and AGGREGATE to produce a summary.
    The formula would be similar to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that the above formula may be activated by simply pressing the Enter key.
    If you need further help please clear the #VALUE! errors in column AC and attach the file to your next post.

  32. #32
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Hi hi
    I have uploaded a new document and I hope you have numbers in AC column to get a new sheet with only the lines with calculation in them.
    Attached Files Attached Files

  33. #33
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    I have also uploaded a second document with no formulas in the main seed so there must be a numbers in AC-column.
    Hope you can help me make a new sheet only with summery with the lines that has calculation in them that is a number in AC-column and a sheet that will work for future caculation
    with other names in other lines as well.

    The column that I would like to have in the new summery sheet are:
    Nr, Name, cost, nr1, Work, sum - cells/columns
    Attached Files Attached Files

  34. #34
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Count different type of text and give me text and sum of numbers

    Wouldn't a pivot table be simpler? You just need to refresh it when your data changes.
    Rory

  35. #35
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    To illustrate rorya's suggestion, on the Pivot Table sheet the pivot table has Value Filters in the Nr column set to Does Not Equal zero.
    Let us know if you have any questions.
    Attached Files Attached Files

  36. #36
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Thank you JeteMc, I have been trying to get the same result in the pivot table as you got, and I am nearly there, I think I am just missing the final step, can you help me with that, I still get some zeros in my Sum of sum
    Attached Files Attached Files

  37. #37
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    For some reason Sucurri is not allowing me to post my response, so I have put it in column T of the attached file.
    Let us know if you have any questions.
    Attached Files Attached Files

  38. #38
    Registered User
    Join Date
    02-09-2022
    Location
    Reykjavik
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    35

    Re: Count different type of text and give me text and sum of numbers

    Thank you so much It worked very well

  39. #39
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Count different type of text and give me text and sum of numbers

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Count Values (Text and Numbers Combination and Text ONLY)
    By bjnockle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2021, 07:01 PM
  2. [SOLVED] Extract Text and Numbers from Custom Type Cell
    By KMVKMVKMV in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-09-2017, 03:10 AM
  3. Replies: 24
    Last Post: 11-10-2015, 07:27 PM
  4. Count number of same type of text in a data range
    By LISARUSSELL123 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-10-2014, 10:48 AM
  5. Replies: 4
    Last Post: 12-20-2012, 04:33 AM
  6. [SOLVED] Type numbers to text
    By Brar in forum Excel General
    Replies: 2
    Last Post: 06-26-2012, 04:22 PM
  7. Count Text & Unique numbers in Text Box
    By l4ya in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2008, 01: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