COUNTIF in a list that contains numbers formatted as text

HMSTPI

New Member
Joined
Jul 31, 2017
Messages
11
Excel 2013 64-Bit: I have a list of text that will NOT count correctly (to get the alphabetical order) and, for the first time I know of, I am unable to find any previous discussion anywhere that is relevant.
ABCD
1ITEMORDERFORMULATEXTCORRECT ORDER
21062287
0=COUNTIF($A$2:$A$6,"<="&$A2)1
31062740 Folio
2=COUNTIF($A$2:$A$6,"<="&$A3)2
41063209 Part
3=COUNTIF($A$2:$A$6,"<="&$A4)3
51063648
0=COUNTIF($A$2:$A$6,"<="&$A5)4
61063832 Folio5=COUNTIF($A$2:$A$6,"<="&$A6)5

<tbody>
</tbody>



Column A and the values within are formatted as TEXT.. When that alone didn't work, I added ' to the beginning of the text in A2 and A5. The ORDER will NOT calculate correctly no matter what I try because it insists on treating A2 and A5 as values. Any suggestions other than adding space or concatenating it with another text value (which I already confirmed does work but SHOULDN'T BE NECESSARY)?

Thanks!
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

HMSTPI

New Member
Joined
Jul 31, 2017
Messages
11
Neither option seem to give the right answer. I ended up having to create a different field to concatenate some text in front of the real sorting target to get it to work. All the years I've worked with Excel -- the text/number/number/text inconsistencies and/or auto-treatment STILL finds a new way to drive me crazy!!! :ROFLMAO:

THANKS for such a quick response though I had already moved on and took this long to reply!!
 

Watch MrExcel Video

Forum statistics

Threads
1,102,867
Messages
5,489,365
Members
407,686
Latest member
Chuck1960

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top