+ Reply to Thread
Results 1 to 4 of 4

To rank text values when there are blank spaces

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    347

    To rank text values when there are blank spaces

    I have a column of text values. I want to rank them alphabetically such as:

    =COUNTIF($A$2:$A$100,"<="&A2)

    The problem is if $A$2:$A$100 contains blank spaces, then the formula will not work as blank spaces are also ranked. Is there a way that I can rank text values while blank spaces are excluded

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

    Re: To rank text values when there are blank spaces

    b2 =a2*1 and drag down.

    and then the countif on column B.
    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
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: To rank text values when there are blank spaces

    Have you tried something like:
    =COUNTIF($A$2:$A$100,"<="&A2)-COUNTIF($A$2:$A$100,"")

  4. #4
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    347

    Re: To rank text values when there are blank spaces

    Hi Ragulduy, your formula works nicely. I added one extra to allow for duplicates:

    =COUNTIF($A$2:$A$100,"<"&A2)+COUNTIF($A$2:A2,A2)-COUNTIF($A$2:$A$100,"")

    The above formula can now rank text values while allowing for blank spaces and duplicates.

+ 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. Removing blank spaces after text
    By ops154 in forum Excel General
    Replies: 6
    Last Post: 01-16-2014, 03:21 PM
  2. [SOLVED] Deleting blank spaces after text
    By longbow007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2013, 02:29 AM
  3. Copying from PDF with blank spaces (text import)
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2013, 02:51 AM
  4. [SOLVED] How to enter blank spaces before and after text in a particular cell
    By amlan009 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2012, 10:37 PM
  5. Eliminating Blank Spaces in Text Cell
    By Greg Shah in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2008, 09:16 AM

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