Removing numbers to the left

  • Thread starter Thread starter mpenkala
  • Start date Start date
M

mpenkala

Hey,

I have a column of cells that contain either 1,2,3 or 4 numbers listed as so:

1
1,3
1,3,8
4,5,6,7

What I want is for a cell to look at the numbers and give me the 2 largest
numbers. If there is only 1 number, then it can return just that one number.


Thanks.
matt
 
The easiest way to do this is in two steps:

1. Separate your data into cells by using Text to Columns
2. Get the two largest numbers using the Large function.

Post back if you need more help on either. Also tell us what version of
Excel you are using.

Regards,
Fred.
 
Hi Fred,
spliting the data with text to columns doesn't work because the numbers are
deterined using a formula. So when I go to use text to columns, it attempts
to break up the formula instead of the numbers given.

Any other ideas? Thanks,
Matt
 
Hey,

I have a column of cells that contain either 1,2,3 or 4 numbers listed as so:

1
1,3
1,3,8
4,5,6,7

What I want is for a cell to look at the numbers and give me the 2 largest
numbers. If there is only 1 number, then it can return just that one number.


Thanks.
matt

Are the numbers always sorted ascending? Then:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))<2,A1,
MID(A1,1+FIND(CHAR(1),SUBSTITUTE(A1,",",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1,",",""))-1)),99))

--ron
 
Assume your numbers are sort in ascending order\
then try this:

=RIGHT(A1,3)
copy down
 
Hey Ron - this one works great, thanks!

Matt

Ron Rosenfeld said:
Are the numbers always sorted ascending? Then:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))<2,A1,
MID(A1,1+FIND(CHAR(1),SUBSTITUTE(A1,",",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1,",",""))-1)),99))

--ron
 
Hey mama,

this would work great except for some of my numbers are double digits.

Thanks though.
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top