How do I get the last number from a specific column

G

Guest

I have my producers listed across the top of my spreedsheet, they are listed
by their producer number, and their pounds are listed below, sample below

220000 223300 456700 345400 675400

3300 4500 4501 2345 3456

4567 2345 6754 5678 2343

Below this I would like to enter a producer number and I want the computer
to give me the last pounds listed for that producer. Can anyone help me?

22300 result
 
R

Ron Rosenfeld

I have my producers listed across the top of my spreedsheet, they are listed
by their producer number, and their pounds are listed below, sample below

220000 223300 456700 345400 675400

3300 4500 4501 2345 3456

4567 2345 6754 5678 2343

Below this I would like to enter a producer number and I want the computer
to give me the last pounds listed for that producer. Can anyone help me?

22300 result

If your producer numbers are in row 1 and the table starts in column A, then,
if your entry cell for the producer number to query is I2:

=INDEX(OFFSET(A:A,0,MATCH(I2,1:1,0)-1),MATCH(
9.9999E+307,OFFSET(A:A,0,MATCH(I2,1:1,0)-1)))

will give the last entry in I2's column.


--ron
 
B

Biff

Hi!

Try this:

Assume your table is in the range A1:En

G1 = producer number

=LOOKUP(9.99999999999999E+307,OFFSET(A1,,MATCH(G1,A1:E1,0)-1,65536))

Note: 65536 refers to the size of the entire column where a match is found
of the producer number. This can be reduced to more reasonable number. If
there are no empty cells within the table you could use something like:

=LOOKUP(9.99999999999999E+307,OFFSET(A1,,MATCH(G1,A1:E1,0)-1,COUNTA(A:A)))

Biff
 
G

Guest

Using the formula you provided, will I be able to change the producer number
and get the results for that producer without changing the formula? If I get
this to work, I'm going to have a list of producer numbers (route for the
day), the pounds will be provided and I'll then do a sum of the pounds and be
able to tell if those producers will all fit on my load.
 
B

Biff

Using the formula you provided, will I be able to change the producer
number
and get the results for that producer without changing the formula?

Yes, using either formula provided. You enter the producer number in a cell
and refer to that cell rather than changing the formula every time you want
to change the producer number.

Ron's formula refers to cell I2 as holding the producer number.
My formula refers to cell G1 as holding the producer number.

These are just examples and you can use whatever cell you want.

Biff
 
G

Guest

The formula you provided works well. Now, I would like to know if I put my
route for the day on worksheet 1 and my producer list with their pounds on
worksheet 2, how would I get the formula to work or is that not possible? Any
suggestions. Thanks.
 
A

Aladin Akyurek

Why not ditch volatile OFFSET?...

=LOOKUP(9.99999999999999E+307,INDEX(A:E,0,MATCH(G1,A1:E1,0)))
 

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

Top