Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 505
Default Excel 2002: How to look up for the last entry ?

Hi,

Lets consider the following illustration:

A B
29 Type Qty
30 P 200
31 Q 201
32 R 202
33 P 203
34 Q 204
35 R 205
36 P 206
37 Q 207
38 R 208
39
40 First Qty
41 P 200
42 Q 201
43 R 202
44
45 Last Qty (what I get)
46 P 200
47 Q 204
48 R 208

Correct answer should be

Last Qty
P 206
Q 207
R 208

I do not have any problem in getting the first quantity from table A29:B38
by entering =VLOOKUP(A41,A$29:B$38,2,FALSE) at cell B41.

However when I replace the third agument of the formula by "TRUE", I could
not get the last quatity at A46:B48.

May I know what is the right formula to use ?

Thanks

Low
--
A36B58K641
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Excel 2002: How to look up for the last entry ?

Hi,

use this to return the last match

=LOOKUP(2,1/($A$29:$A$38=A41),$B$29:$B$38)

Mike

"Mr. Low" wrote:

Hi,

Lets consider the following illustration:

A B
29 Type Qty
30 P 200
31 Q 201
32 R 202
33 P 203
34 Q 204
35 R 205
36 P 206
37 Q 207
38 R 208
39
40 First Qty
41 P 200
42 Q 201
43 R 202
44
45 Last Qty (what I get)
46 P 200
47 Q 204
48 R 208

Correct answer should be

Last Qty
P 206
Q 207
R 208

I do not have any problem in getting the first quantity from table A29:B38
by entering =VLOOKUP(A41,A$29:B$38,2,FALSE) at cell B41.

However when I replace the third agument of the formula by "TRUE", I could
not get the last quatity at A46:B48.

May I know what is the right formula to use ?

Thanks

Low
--
A36B58K641

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Excel 2002: How to look up for the last entry ?

for the last match try
=lookup(2,1/($a$1:$a$29=p),$b$1:$b$29)

"Mr. Low" wrote:

Hi,

Lets consider the following illustration:

A B
29 Type Qty
30 P 200
31 Q 201
32 R 202
33 P 203
34 Q 204
35 R 205
36 P 206
37 Q 207
38 R 208
39
40 First Qty
41 P 200
42 Q 201
43 R 202
44
45 Last Qty (what I get)
46 P 200
47 Q 204
48 R 208

Correct answer should be

Last Qty
P 206
Q 207
R 208

I do not have any problem in getting the first quantity from table A29:B38
by entering =VLOOKUP(A41,A$29:B$38,2,FALSE) at cell B41.

However when I replace the third agument of the formula by "TRUE", I could
not get the last quatity at A46:B48.

May I know what is the right formula to use ?

Thanks

Low
--
A36B58K641

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Excel 2002: How to look up for the last entry ?

Since I suspect that you may have more than just 3 groups of these to deal
with, I'll steal from Mike H and sheryarkhan's solutions and change a piece
so that it will return the last group even if you have 20 or 30 or 100
instead of just 3:

=LOOKUP(COUNTIF(A$29:A$38,A46)-1,1/($A$29:$A$38=A46),$B$29:$B$38)
that's for the P match at row 46.

"Mr. Low" wrote:

Hi,

Lets consider the following illustration:

A B
29 Type Qty
30 P 200
31 Q 201
32 R 202
33 P 203
34 Q 204
35 R 205
36 P 206
37 Q 207
38 R 208
39
40 First Qty
41 P 200
42 Q 201
43 R 202
44
45 Last Qty (what I get)
46 P 200
47 Q 204
48 R 208

Correct answer should be

Last Qty
P 206
Q 207
R 208

I do not have any problem in getting the first quantity from table A29:B38
by entering =VLOOKUP(A41,A$29:B$38,2,FALSE) at cell B41.

However when I replace the third agument of the formula by "TRUE", I could
not get the last quatity at A46:B48.

May I know what is the right formula to use ?

Thanks

Low
--
A36B58K641



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 505
Default Excel 2002: How to look up for the last entry ?

Hi Mike,

Thanks for your formula.

It works.

Best Regards

Low

--
A36B58K641


"Mike H" wrote:

Hi,

use this to return the last match

=LOOKUP(2,1/($A$29:$A$38=A41),$B$29:$B$38)

Mike

"Mr. Low" wrote:

Hi,

Lets consider the following illustration:

A B
29 Type Qty
30 P 200
31 Q 201
32 R 202
33 P 203
34 Q 204
35 R 205
36 P 206
37 Q 207
38 R 208
39
40 First Qty
41 P 200
42 Q 201
43 R 202
44
45 Last Qty (what I get)
46 P 200
47 Q 204
48 R 208

Correct answer should be

Last Qty
P 206
Q 207
R 208

I do not have any problem in getting the first quantity from table A29:B38
by entering =VLOOKUP(A41,A$29:B$38,2,FALSE) at cell B41.

However when I replace the third agument of the formula by "TRUE", I could
not get the last quatity at A46:B48.

May I know what is the right formula to use ?

Thanks

Low
--
A36B58K641

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002 date entry: Cannot get away from d-m-yy entry format Steve Eklund Excel Discussion (Misc queries) 3 May 11th 09 04:57 PM
Excel 2002 : Can auto cell entry function more than once ? Mr. Low Excel Discussion (Misc queries) 2 July 27th 07 05:18 PM
Excel 2002 : Is there any active row bar to aid data entry ? Mr. Low Excel Discussion (Misc queries) 3 February 8th 07 08:32 PM
Outlook 2002 calendar dates exported to Excel 2002 sort incorrectl scampbell Excel Worksheet Functions 0 February 22nd 06 06:31 PM
Can you print labels using Excel 2002 in a Word 2002 mail merge? Individual_ Excel Discussion (Misc queries) 3 December 17th 04 08:39 PM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"