wu :: forums
« wu :: forums - Excel help please. »

Welcome, Guest. Please Login or Register.
May 28th, 2024, 8:04pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: SMQ, Eigenray, william wu, ThudnBlunder, Grimbal, Icarus, towr)
   Excel help please.
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Excel help please.  (Read 819 times)
aicoped
Junior Member
**





   


Gender: male
Posts: 57
Excel help please.  
« on: Dec 30th, 2008, 9:15pm »
Quote Quote Modify Modify

OK, first you guys have been very helpful. I did not want to start a new thread, but I have an excel question related to a different problem.  
 
Let me explain what I want to do first. I want to generate 5000 random numbers between 1-20. I know how to do that no problem. I want to know an easy way to tell for example where the first 1 shows up and the second 1 and third 1etc up to the 10th time it appears in the list, in a table format, and I want this to do that for all 20 numbers.  
 
So for example if the first 1 showed up on the thirteenth line, I would need some way to get that into the table under column 1 and row 1st appearance, somehow.  
 
Any help you guys have in this would be greatly appreciated.  
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Excel help please.  
« Reply #1 on: Dec 31st, 2008, 12:42am »
Quote Quote Modify Modify

You could give something like http://www.ozgrid.com/Excel/find-nth.htm a try, maybe. I'm not sure, I'm not good with spreadsheets.
 
Or maybe add a column with the positions 1-5000, then sort both columns together, first on the first then on the second.
« Last Edit: Dec 31st, 2008, 12:45am by towr » IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Excel help please.  
« Reply #2 on: Dec 31st, 2008, 8:43am »
Quote Quote Modify Modify

I had to look it up.
 
There is the function MATCH(value,array,type)
   value is the value you are searching for.
   array is the array to search.
   type must be 0 for an unordered array.
   returned is the 1-based index of the first occurrence of the value in the array.
IP Logged
aicoped
Junior Member
**





   


Gender: male
Posts: 57
Re: Excel help please.  
« Reply #3 on: Dec 31st, 2008, 12:19pm »
Quote Quote Modify Modify

OK so lets say my numbers are all in column c1:c5000
 
And i want to find the first occurence of 20 I would type =MATCH(20,C1:C5000,0)
 
Now what would i type to find the second 20 in that list?
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Excel help please.  
« Reply #4 on: Jan 1st, 2009, 5:16pm »
Quote Quote Modify Modify

Ah, I didn't see you also want the second and third.  Then it seems the link given by towr would help.  Another way is to write a small visualbasic program that searches the loop.
IP Logged
Ub3r_h4Ck3r
Newbie
*



I wish to die programming :-)

   


Gender: male
Posts: 4
Re: Excel help please.  
« Reply #5 on: Jan 7th, 2009, 12:18pm »
Quote Quote Modify Modify

This problem motivated me to design this question.
 
Given a list of 5000 numbers with numbers from say 1 to 20. how to design a data structure that will tell me the positions of each number.
 
The obvious solution will be to maintain a two-dimensional linked list. Is there any better way to do this. I would like the datastructure to perform these operations in an efficient way.
 
1. Number of elements of each value.
2. Which element has max occurences.
3. Average distance for each value.
4. Maximum average distance for each value.
 
Let me know what you think.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board