View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default automatic display of last 2 entries in tHe column to specified cel

Your post raises several questions. Shane has posted a couple of them; I am
wondering if the last 2 cells in C are the same and the last 2 cells in D
are not (and vice versa), are they then considered different such that both
should be shown in A and B? Also, could there be any empty cells in columns
C and D?

Here is my guess as to what you want.

A1:
=INDEX(C:C,COUNTA(C:C)-1)

A2:
=IF(AND(INDEX(C:C,COUNTA(C:C))=A1,INDEX(D:D,COUNTA (D:D))=B1),"",INDEX(C:C,COUNTA(C:C)))

B1:
=INDEX(D:D,COUNTA(D:D)-1)

B2:
=IF(AND(INDEX(C:C,COUNTA(C:C))=A1,INDEX(D:D,COUNTA (D:D))=B1),"",INDEX(D:D,COUNTA(D:D)))

--
Rick (MVP - Excel)


"mike CBA" wrote in message
...
what is the formula for automatically displaying the last 2 entries in
columns C and D to columns A and B. But, if the last 2 entries are the
same,
only the 2nd last will be displayed. to illustrate:
1st scenario:
A B C D
5 10.50 20 10.50
10 11.00 15 11.00
5 10.50
10 11.00

2nd scenario:
A B C D
5 10.50 20 10.50
15 10.500
5 10.50
5 10.50