Textjoin / iferror and ifs

Allen_Mead

New Member
Joined
May 31, 2019
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to pull data into a single cell from a table which has to days of the week on the horizontal axis and people on the vertical axis. The results depends if some is present on a particular day or not. I have text separators in the form of colons and semi colons. This is great but, I want to make them disappear if they are not needed for example:

Currently shows as:
Bob Jones: Monday, Aldgate: Tuesday, St Albans, ; , ; ,

I'd like to be able to get it to show as:
Bob Jones: Monday, Aldgate: Tuesday, St Albans,

Excel formula below. Thanks in advance. PS, if there's a better way/ shorter way with the formula, I'm all ears. - Why all this in a single cell, because it's a challenge!

Excel Formula:
=TEXTJOIN(CHAR(10),TRUE,'7.Attendance'!A4:A15&TEXT(,": ")&IFERROR(IFS(B4:B15="Aldgate",B2,B4:B15="St Albans",B2),"")&TEXT(,", ")&IFERROR(IFS(B4:B15="Aldgate","Aldgate",B4:B15="St Albans","At Albans"),"")&TEXT(,": ")&IFERROR(IFS(C4:C15="Aldgate",C2,C4:C15="St Albans",C2),"")&TEXT(,", ")&IFERROR(IFS(C4:C15="Aldgate","Aldgate",C4:C15="St Albans","St Albans"),"")&TEXT(,": ")&IFERROR(IFS(D4:D15="Aldgate",D2,D4:D15="St Albans",D2),"")&TEXT(,", ")&IFERROR(IFS(D4:D15="Aldgate","Aldgate",D4:D15="St Albans","St Albans"),"")&TEXT(,": ")&IFERROR(IFS(E4:E15="Aldgate",E2,E4:E15="St Albans",E2),"")&TEXT(,", ")&IFERROR(IFS(E4:E15="Aldgate","Aldgate",E4:E15="St Albans","St Albans"),"")&TEXT(,": ")&IFERROR(IFS(F4:F15="Aldgate",F2,F4:F15="St Albans",F2),"")&TEXT(,", ")&IFERROR(IFS(F4:F15="Aldgate","Aldgate",F4:F15="St Albans","St Albans"),""))
 

Attachments

  • Screenshot 2023-12-15 112033.png
    Screenshot 2023-12-15 112033.png
    45.9 KB · Views: 17
You're welcome & thanks for the feedback.
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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