Lookup with multiple results but only once

Montanes

New Member
Joined
Aug 18, 2016
Messages
39
Office Version
  1. 365
Platform
  1. Windows
I have a list of vehicles that are scheduled for maintenance work over 8 columns and 1873 rows (including the header).

Each vehicle is assigned to a department.

Column 'A' has the week number
Column 'G' has the department

If I enter a week number in cell J1 i am hoping to generate a list of departments from J2 downwards that have a vehicle scheduled for that week.

However, some departments may have multiple vehicles scheduled for a specific week and i only want it listed once...which is the part i am struggling with.

My head is mush trying to get this. Thank-you to anyone who can help.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Could you supply an sample image of what you are working with?
 
Upvote 0
Hi,

Please see attached snipping.

So the theory is that i would select a week number in cell J1, and under this i would have a list of all the departments that have a vehicle scheduled for that week. In the attached i have entered '1' as the week i want to look at and i would want all the departments to be listed but everything i do has "Sales" listed twice whereas i am trying to figure out how to remove the duplicates.

I hope i am explaining this correctly, thanks for your help.
 

Attachments

  • Capture.PNG
    Capture.PNG
    19.4 KB · Views: 14
Upvote 0
If you have Excel 365 with the FILTER and UNIQUE functions then try the formula in L2. Otherwise try the formula in J2 which is an array function and must be entered with CTRL-SHIFT-ENTER.

Book1
ABCDEFGHIJKL
1WeekDept.1
21AcctAcctAcct
31WorkshopWorkshopWorkshop
41SalesSalesSales
51OperOperOper
61RecRecRec
71Sales 
Sheet1
Cell Formulas
RangeFormula
L2L2=UNIQUE(FILTER($F$2:$F$7,$A$2:$A$7=$J$1,""))
J2:J6J2{=IFERROR(INDEX($F$2:$F$7,SMALL(IF(FREQUENCY(MATCH($F$2:$F$7,$F$2:$F$7,0),ROW($F$2:$F$7)-ROW($F$2)+1),ROW($F$2:$F$7)-ROW($F$2)+1),ROWS($J$2:J2))),"")}
J7J7=IFERROR(INDEX($F$2:$F$7,SMALL(IF(FREQUENCY(MATCH($F$2:$F$7,$F$2:$F$7,0),ROW($F$2:$F$7)-ROW($F$2)+1),ROW($F$2:$F$7)-ROW($F$2)+1),ROWS($J$2:J7))),"")
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
There was an error in the formula in J2 above. It should be:
Enter with CTRL-SHIFT-ENTER.

Book1
ABCDEFGHIJ
1WeekDept.1
21AcctAcct
31WorkshopWorkshop
41SalesSales
51OperOper
61RecRec
71Sales 
Sheet1
Cell Formulas
RangeFormula
J2:J7J2{=IFERROR(INDEX($F$2:$F$7,SMALL(IF(FREQUENCY(IF($A$2:$A$7=$J$1,MATCH($F$2:$F$7,$F$2:$F$7,0)),ROW($F$2:$F$7)-ROW($F$2)+1),ROW($F$2:$F$7)-ROW($F$2)+1),ROWS($J$2:J2))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top