MCONCAT leaves spaces for unmatched values

darkgear.com

New Member
Joined
Mar 10, 2005
Messages
10
This is my first attempt at making a departmental calendar to track vacation and also to view who is taking vacation on what day. I also want to be able to filter by individual departments.

I started with a simple entry form.
2006-Calendar.xls
ABCD
1DateEEDeptPTO
21/1/06AlbertUSS8
31/1/06MercyRating8
41/3/06NaomiRecords8
51/4/06DustinRecords8
61/5/06AlbertUSS4
71/5/06AmyRating8
81/5/06DonnaClerk8
91/5/06DorothyClerk8
101/5/06DustinRecords8
111/5/06LindaRecords8
121/5/06MiriamRating2
131/5/06NaomiRecords4
141/5/06PollyRating8
151/5/06SophiaRecords8
161/6/06DonnaClerk8
171/6/06NitaRating8
Summaries


I then made a calendar and started working on the formula to display who was on vacation for the day and made it possible to filter by department.
2006-Calendar.xls
IJKL
1Department
2ThursdayFriday
356
4Albert Amy Donna Dorothy Dustin Linda Miriam Naomi Polly SophiaDonna Nita
Jan


K1 is data validated so you can select one of the departments.

Ugly formula I used to get the names to display...

{=IF($K$1="",MCONCAT(IF(VALUE(CONCATENATE("1","/",J3,"/","2006"))='Data Entry'!$A$2:$A$70,'Data Entry'!$B$2:$B$70,"")," "),MCONCAT(IF(VALUE(CONCATENATE("1","/",J3,"/","2006"))='Data Entry'!$A$2:$A$70,IF($K$1='Data Entry'!$C$2:$C$70,'Data Entry'!$B$2:$B$70,"")," ")))}

My question is is there a better way to handle the display of names? Using MCONCAT works but it places an extra space(or comma or whatever I use to separate names) after every row that it did NOT find a match. So towards the end of the year I could end up with scores of spaces before the first name shows up.

Best regards,
Randy
:biggrin:
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
=IF($K$1<>"",SUBSTITUTE(MCONCAT(IF('Data Entry'!$A$2:$A$70=(J3&"-Jan-2006")+0,IF('Data Entry'!$C$2:$C$70=$K$1," "&'Data Entry'!$B$2:$B$70,""),""))," ","",1),"")

which must be confirmed with control+shift+enter.
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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