Remove spaces from index/match list

cpclarke

New Member
Joined
Jun 6, 2016
Messages
10
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hello All,
I have a table "CompanyTBL" (A2:B10) and a Named List "TradeLST" (B2:B10). I want to collate a list of company names (the green coloured list) that match the criteria (as shown below). The function shown in inserted into the green list D2 etc. and copied to all cells. It returns the correct values but I want to exclude the "null" values (spaces) in the list. This list will be used later by another dependent dropdown selection so don't want any empty cells. How do modify my function to remove the null cell values and group the returned values to the top of each column? Any help much appreciated.

=IF(COUNTIF(INDEX(CompanyTBL,MATCH($B2,TradeLST,0),2),D$1),$A2,"")

1653138302777.png
 

Attachments

  • 1653138214614.png
    1653138214614.png
    24.3 KB · Views: 18

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try

Formula in D2 copied across until H2 and down
=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/($B$2:$B$10=D$1),ROWS(D$2:D2))),"")

Hope this helps

M.
 
Upvote 0
Marcelo,
I don't understand your black magic yet, buy your formula worked! I will have to unpack and digest it later but this gets a job off my desk. Many, many thanks to you.

Phil
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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