Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Filter / Lookup: Display record on new sheet based on category...

Hey all -
This one might be a little tricky. I need a formula that looks at data
on another sheet and displays records that match a given category (skipping
blank cells). Here's the format of sheet 1:
A B
item1 category1
item2 category2
item1 category1
item3 category3

My 2nd sheet has a header bar for each category with every record for that
category listed below it. I'd like to have a formula in the cells below the
header for each category that does all the heavy lifting (looks at sheet 1,
matches records to the category, skips blanks, and lists each individual
matching record - no dupes).

I've used the following formula before (in another workbook) to do all of
the above except search for / match a specific category (criteria)... i
haven't been able to edit it for this use:

=IF(ROWS($1:2)<=COUNTA(Sched!B:B),INDEX(Sched!B:B, SMALL(IF(Sched!B$1:B$999<"",ROW(Sched!B$1:B$999)-MIN(ROW(Sched!B$1:B$999))+1),ROWS($1:2))),"")

I don't want to use macros or filters if possible.

thanks in advance!
meat
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Filter / Lookup: Display record on new sheet based on category...

One option which delivers ..

Assume source data (sample below) is in sheet: x*,
cols A and B, data from row2 down
item1 category1
item2 category2
item1 category1

etc

*I'd use very short source sheetnames, makes formulas look lean

In D1 across are listed the unique categories: category1, category2, etc
Put in D2:
=IF(OR($B2="",D$1=""),"",IF($B2=D$1,IF(SUMPRODUCT( ($A$2:$A2=$A2)*($B$2:$B2=$B2))1,"",ROW()),""))
Copy D2 across/fill down as far as required to cover the max expected extent
of source data

Then in a new sheet (your 2nd sheet),
In A1: =IF(x!D1="","",x!D1)
Copy A1 across as far as required to bring in all the categories from x

In A2:
=IF(ROWS($1:1)COUNT(OFFSET(x!$C:$C,,MATCH(A$1,x!$ D$1:$IV$1,0))),"",INDEX(x!$A:$A,SMALL(OFFSET(x!$C: $C,,MATCH(A$1,x!$D$1:$IV$1,0)),ROWS($1:1))))
Copy A2 across/fill down as far as required to cover the max expected number
of items per any single category. This will return the required results under
each category, with all results neatly bunched at the top.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"MeatLightning" wrote:
This one might be a little tricky. I need a formula that looks at data
on another sheet and displays records that match a given category (skipping
blank cells). Here's the format of sheet 1:
A B
item1 category1
item2 category2
item1 category1
item3 category3

My 2nd sheet has a header bar for each category with every record for that
category listed below it. I'd like to have a formula in the cells below the
header for each category that does all the heavy lifting (looks at sheet 1,
matches records to the category, skips blanks, and lists each individual
matching record - no dupes).

I've used the following formula before (in another workbook) to do all of
the above except search for / match a specific category (criteria)... i
haven't been able to edit it for this use:

=IF(ROWS($1:2)<=COUNTA(Sched!B:B),INDEX(Sched!B:B, SMALL(IF(Sched!B$1:B$999<"",ROW(Sched!B$1:B$999)-MIN(ROW(Sched!B$1:B$999))+1),ROWS($1:2))),"")

I don't want to use macros or filters if possible.

thanks in advance!
meat

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
how do I filter a list of items based on values in another sheet jumpsystems Excel Discussion (Misc queries) 0 June 8th 07 12:10 PM
Filter Range on Sheet B Based on List on Sheet A Brent E Excel Discussion (Misc queries) 4 April 23rd 07 04:10 PM
Display every 3rd category name but still display latest month maryj Charts and Charting in Excel 1 September 24th 06 09:05 PM
Filter, sort, lookup from other sheet falloutx Excel Discussion (Misc queries) 2 January 18th 06 04:36 PM
Lookup cell contents in on sheet based on a formula in second sheet Michael Wright via OfficeKB.com Excel Worksheet Functions 1 April 30th 05 04:11 PM


All times are GMT +1. The time now is 03:31 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"