Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
 
Posts: n/a
Default Filter data based on multiple columns

I would like to see the unique values from column A, where Column B is
a max() for that value in A. For example, in Column A there are
several 1's, I would like to see the max of column B, where column A is
a 1, and the same thing repeated for all the other unique values in
column A.

INPUT:

A B
1 07/22/05
1 08/26/05
1 10/11/05
2 11/04/05
2 01/04/06
2 07/22/05
3 08/26/05
4 10/11/05
4 11/04/05

The output I'm looking for would look like this:

A B
1 10/11/05
2 01/04/06
3 08/26/05
4 11/04/05

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Ron Coderre
 
Posts: n/a
Default Filter data based on multiple columns

Try a Pivot Table:

First, make sure your table has column headings
(exampe: A1: MyNumber, B1: MyDate)

<Data<Pivot Table
Use: Excel
Select your data range
Click the [Layout] button

ROW: Drag the MyNumber field here
DATA: Drag the MyDate field here
Dbl-click it and set it to Max
Click [OK]
Select where you want the Pivot Table...and you're done!

That will list each MyNumber and the Max of dates for each MyNumber.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


" wrote:

I would like to see the unique values from column A, where Column B is
a max() for that value in A. For example, in Column A there are
several 1's, I would like to see the max of column B, where column A is
a 1, and the same thing repeated for all the other unique values in
column A.

INPUT:

A B
1 07/22/05
1 08/26/05
1 10/11/05
2 11/04/05
2 01/04/06
2 07/22/05
3 08/26/05
4 10/11/05
4 11/04/05

The output I'm looking for would look like this:

A B
1 10/11/05
2 01/04/06
3 08/26/05
4 11/04/05


  #3   Report Post  
Posted to microsoft.public.excel.newusers
 
Posts: n/a
Default Filter data based on multiple columns

Yea, that worked, but now here's the next problem...I have about 20
columns after the first two columns, that I will also need to display
for that combination of column A&B. How can I do this with a
pivottable?

  #4   Report Post  
Posted to microsoft.public.excel.newusers
Ron Coderre
 
Posts: n/a
Default Filter data based on multiple columns

See if this array formula* approach works for you:

Assumptions:
Your data table is in A1:V10
MyNumber, MyDate, MyField_1, MyField_2.....MyField_20


Your pivot table begins in cell A20 and extends through B?? (depending on
returned values)

So...A20: Max of MyNumber
A21: MyNumber
B21: Total

C21: MyField_1
C22:
=INDEX($C$1:$C$10,MATCH($A22&"_"&TEXT($B22,"yyyymm dd"),$A$1:$A$10&"_"&TEXT($B$1:$B$10,"yyyymmdd"),0) )

Copy from C22 to C23 and down as far as needed
Copy the Col_C formulas to Col_D and as far to the right as needed

*Note: For array formulas, hold down [Ctrl] and [Shift] when you press
[Enter].

Those formulas return the data associated with each unique MyNumber and the
corresponding Max of MyDate for that MyNumber.

Sample returned values (with my test data):
Max of MyDate
MyNumber_____Total____Field_1__Field_2_____Field_3
1_________10/11/05_c101_______c101_______c101
2_________01/04/06_c10001_____c10001_____c10001
3_________08/26/05_c1000001___c1000001___c1000001
4_________11/04/05_c100000001_c100000001_c100000001

Is that something you can work with?

***********
Regards,
Ron

XL2002, WinXP-Pro


" wrote:

Yea, that worked, but now here's the next problem...I have about 20
columns after the first two columns, that I will also need to display
for that combination of column A&B. How can I do this with a
pivottable?


  #5   Report Post  
Posted to microsoft.public.excel.newusers
 
Posts: n/a
Default Filter data based on multiple columns

Thanks, that worked perfectly. I ended up adding in a dynamic named
range for my pivottable, then hid the sheet where the table resides. I
added a macro for the end user to update the pivottable, without them
needing to know that it was even there. For the arrays, I added a
dynamic named range for each of my columns, so that they would update
accordingly when new rows are added.



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
In Excel how can I filter multiple columns SIMULTANEOUSLY? Keleigh-G Excel Discussion (Misc queries) 5 May 25th 06 08:09 PM
combining multiple rows of data into one single row of data myersjl Excel Worksheet Functions 0 March 30th 06 10:39 PM
I've put data to columns - counted - need dropdown filter vic 2005 Excel Discussion (Misc queries) 0 September 1st 05 12:31 PM
Convert 1 row of data into Multiple columns Mohoney Excel Discussion (Misc queries) 1 August 25th 05 12:36 PM
Finding common data in multiple columns and rows in Excel sparham Excel Worksheet Functions 3 February 12th 05 04:11 AM


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

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

About Us

"It's about Microsoft Excel"