View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RagDyeR RagDyeR is offline
external usenet poster
 
Posts: 3,572
Default Separating characters from a cell so I can sort on them

You can kill 2 birds with one stone using TTC (Text To Columns).

Select the column of data in Column A, then, from the Menu Bar:

<Data <TextToColumns <Delimited <Next

On the 2nd page of the TTC wizard, click on "Other",
And key in the dash, in the next box.

If you look down in the "Data Preview" window, you'll see the way the data
will be separated.

Now, just click <Finish.

You should have your first column in a calculable format, and the second
column ready to be used as the sort key.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Princess Caroline" wrote in
message ...
Ok, I got this to work. Wonder if I could actually remove the -B or -P
from
the number so I can total the number?

"RagDyer" wrote:

You can create a "helper" column, where you extract the last letter, and
then sort both columns together, using the helper column as the sort key.

Say your data was in Column A.

In B1 enter this formula:

=Right(A1)

And then copy down as needed.

You might try *double* clicking on the fill handle (little black square
in
the lower right corner of a *selected* cell).

This will *automatically* copy the formula in B1 down Column B, as far as
there is data in Column A.

Now select both columns, and sort on Column B.


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Princess Caroline" wrote in
message ...
I've got data that includes a variable. Either -B or -P. I need to
sort
on
this variable.
348.00-P
113.20-P
2023.90-B
411.00-B
504.00-B
135.00-P

Simple explaination, please. I don't really speak Excel language very
well...
Thanks