Excel: finding first and last unique record
February 4, 2008 12:10 PM
Subscribe
Finding and copying the first and last value, to the left of a range in excel.
First of all
here is a screenshot of an example.
What I want to do is for each unique value in column B, copy the first and last value in column A, and put them in a single cell on column C.
So for the screen shot above, the following would be outputed:
C
------------------------
1 |2006Q3 - 2007Q4|
2 |2006Q4 - 2007Q4|
3 |2006Q4 - 2007Q4|
Is there any sort of macro that would do this?
posted by corpse to computers & internet (6 comments total)
=IF(B1<>B2,OFFSET(A1,-COUNTIF(B:B,B1)+1,0) & " - " & A1,"")>Upon the last instance of an entry in the group of items, it will offset back to the first entry in that group, and concatenate the values from column A for the first and last entries...
posted by Chunder at 12:37 PM on February 4