+ Reply to Thread
Results 1 to 13 of 13

Counting Range

  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Counting Range

    I have say as follows on column a with a4 as blank , I want formula to count column a where i need the answer to be 5
    that is first cell count to last cell with text

    a
    b
    c

    d

  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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: Counting Range

    Try again to explain what you want. You have listed four text items (a,b,c,and d) with a blank between c and d. If I were to count the text items, there would be 4 - how do you get 5?
    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
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Counting Range

    Try this, e.g. in C1:

    =MATCH(LOOKUP("zzz",A:A),A:A,0)

    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Re: Counting Range

    Thank you Pete_Uk , seems you got me straight without further questions

  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,791

    Re: Counting Range

    It will only work properly if the text values are all unique.

    Pete

  6. #6
    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,300

    Re: Counting Range

    It will only work properly if the text values are all unique.
    really ?????

  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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: Counting Range

    It will only work if the last item is unique because the MATCH function returns the row of the first instance of that item found.

  8. #8
    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,300

    Re: Counting Range

    Yes but chances of it being "ZZZ" ? Better use "ZZZZZZZZ" !

    It isn't really a question of uniqueness but of relative values.

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Counting Range

    Quote Originally Posted by AliGW View Post
    It will only work if the last item is unique because the MATCH function returns the row of the first instance of that item found.
    No. =MATCH("zzz",A:A) returns row() of the last cell populated with text. It doesn't care about any duplicates.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  10. #10
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: Counting Range

    No, John. Consider a list like this:

    a
    b
    c

    d
    c
    a

    c

    Which row number will be returned? 3, 6 or 9? We want 9, but it will return 6 becasue that is the first row it appears in.

    =MATCH(LOOKUP("zzz",A:A),A:A,0) gives 3

    =LOOKUP(2,1/(A:A<>""),A:A) gives c

  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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: Counting Range

    Quote Originally Posted by AlKey View Post
    No. =MATCH("zzz",A:A) returns row() of the last cell populated with text. It doesn't care about any duplicates.
    OK - so it's the LOOKUP bit that's causing it.

  12. #12
    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,300

    Re: Counting Range

    Me being word blind: I had used MATCH as per Alkey's response: hence my query!

  13. #13
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: Counting Range

    Yes, there's a subtle difference I hadn't appreciated before now!

+ 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. Counting a range of cells with dates within a certain range
    By MSE in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-17-2017, 05:03 PM
  2. [SOLVED] Counting a specific characters in a range using a criteria from another range
    By Wamperdz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-05-2015, 09:32 PM
  3. Replies: 1
    Last Post: 05-05-2015, 06:43 PM
  4. Replies: 1
    Last Post: 12-25-2014, 02:25 PM
  5. [SOLVED] Counting how many times a range of key words come up in a range of cells
    By Piepongwong in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-04-2014, 02:38 PM
  6. Counting instances in one cell range for days of week in another range
    By NGothIda in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-13-2014, 12:11 PM
  7. [SOLVED] Counting a range of stats if another range rule is met
    By robmc in forum Excel General
    Replies: 2
    Last Post: 07-23-2012, 09:03 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