Any Software That Could Help me Sort List of Numbers?

agag2

Supreme Member
Joined
Feb 17, 2009
Messages
1,303
Reaction score
260
Hi

I have a task to do and looking for something (software) that could help me w this ill do my best to explain the task


if i had a list of numbers (random) like
4
7
2
3
4
6
4
2
1
7
4

and i wanted to make a chart where each number comes up next - in the example above it would be (if 4 on the bottom is first)
4
7
2
3
4 - 4
6 - ?
4 - ? <
2 - 5 |
1 - ? |
7 - 8 |
4 - 4 ^


so the software should be able to spit out the number on the right - that number being the number it came up again like 4 came up 4 later so it would be 4 on the right


I would have a list of 1000 + numbers.


I hope i did a good job explaining my need.. otherwise pls let me know

is there a software/way to accomplish this?

thanks
 
You could put together a function in excel that will do this.

Is the next answer for the 4, 2?

If so you could definitely do this in excel...
 
You could put together a function in excel that will do this.

Is the next answer for the 4, 2?

If so you could definitely do this in excel...


yup

how would I do this w excel pls? (could it be done in openoffice too?0

thanks
 
Last edited:
can anyone lead me in the right direction? Im new to excel
 
yup

how would I do this w excel pls? (could it be done in openoffice too?0

thanks


I don't know what exactly your asking, BUT, whatever MS suite can do, open office can do. For OpenOffice, you would use "OpenOffice Spreadsheet" (its the same as MS excel)
 
I don't know what exactly your asking, BUT, whatever MS suite can do, open office can do. For OpenOffice, you would use "OpenOffice Spreadsheet" (its the same as MS excel)


Ill give another example say I had a list of numbers - on the left side
8
4
2
3
5
7
3
2 <<<<
5
8 - 9
9 - ?
2 - 4 <<<


and I now fill in the right side. Starting from the bottom and going upwards we see "2" the next time "2" is mentioned is 4 later so on the left side i would fill in 4 (see in blue) the same is w 9 - but since its not menioned in this list we go on to the next 8 would be 9 etc etc etc


I hope you understand what i mean now

thanks
 
agag2, see my PM to you about using vlookup and match. It should help you.

Good luck
 
not tested but here ya go
doesnt go from bottom up but it achieves the same result

PHP:
<?php
if(ISSET($_POST['text'])){
    $data = explode("\r\n",$_POST['text']);
    $cd = count($data);
    $v =array();
    for($i=0;$i<$cd;++$i){
        if(ISSET($v[$data[$i]])){
            $s= ' - ' . ($i-$v[$data[$i]]).'<br />';
            $v[$data[$i]] = $i; 
        }else{
            $v[$data[$i]] = $i;   
            $s='<br />';
        }
        echo $data[$i] . $s;
    }
}else{
 echo '<form action="" method="POST">
 <textarea name="text" rows=30 cols=50>8
4
2
3
5
7
3
2
5
8
9
2</textarea>
 <input type=submit name=submit value=calc />
 </form>';
}
?>
 
not tested but here ya go
doesnt go from bottom up but it achieves the same result

PHP:
<?php
if(ISSET($_POST['text'])){
    $data = explode("\r\n",$_POST['text']);
    $cd = count($data);
    $v =array();
    for($i=0;$i<$cd;++$i){
        if(ISSET($v[$data[$i]])){
            $s= ' - ' . ($i-$v[$data[$i]]).'<br />';
            $v[$data[$i]] = $i; 
        }else{
            $v[$data[$i]] = $i;   
            $s='<br />';
        }
        echo $data[$i] . $s;
    }
}else{
 echo '<form action="" method="POST">
 <textarea name="text" rows=30 cols=50>8
4
2
3
5
7
3
2
5
8
9
2</textarea>
 <input type=submit name=submit value=calc />
 </form>';
}
?>

thanks for the code but i just tried it and it does not out put the correct numbers

here's what i got
8
4
2
3
5
7
3
2
5
8
9
2


2 should be 4 .....
 
not tested but here ya go
doesnt go from bottom up but it achieves the same result

PHP:
<?php
if(ISSET($_POST['text'])){
    $data = explode("\r\n",$_POST['text']);
    $cd = count($data);
    $v =array();
    for($i=0;$i<$cd;++$i){
        if(ISSET($v[$data[$i]])){
            $s= ' - ' . ($i-$v[$data[$i]]).'<br />';
            $v[$data[$i]] = $i; 
        }else{
            $v[$data[$i]] = $i;   
            $s='<br />';
        }
        echo $data[$i] . $s;
    }
}else{
 echo '<form action="" method="POST">
 <textarea name="text" rows=30 cols=50>8
4
2
3
5
7
3
2
5
8
9
2</textarea>
 <input type=submit name=submit value=calc />
 </form>';
}
?>

this just spits out the same numbers again? Is there a mistake here?
 
Back
Top