CONCAT formula to generate 3 outcomes depending on data in a specific column

timjo

New Member
Joined
Jan 1, 2025
Messages
9
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
  2. Mobile
Hi Forum Members,

I have a table that has a variety of data, and I want to leverage that data to generate folder names. I plan to use the CONCAT formula, and I have the structure sorted with the formulas in the Folder Names sheet. But I need help to finalise the formula as there are 3 possible outcomes depending on the data in column E in the Schedule Tracker sheet. I have left 2 columns without for privacy reasons.

Active Tasks.xlsx
ABCDE
1IDJob #BuildingSupervisorTask Name
224481St Helens Community CentreHeight Safety System - 12 Months
324482St James Park Tennis Courts and ClubhouseHeight Safety System - 12 Months
424483Public Toilets - Watson RoadHeight Safety System - 12 Months
524484Town Hall HouseHeight Safety System - 12 Months
624485The Crescent Early Learning CentreHeight Safety System - 12 Months
724486Redfern Community CentreHeight Safety System - 12 Months
824487Public Toilets and Garden Shed -Bourke Street ParkHeight Safety System - 12 Months
924488Public Toilet - 13A Refinery DriveHeight Safety System - 12 Months
1024598Huntley Street Early Learning CentreHeight Safety System - 12 Months
1123866Erskineville Town HallHeight Safety System - 12 Months
1224454Erskineville Arts CentreHeight Safety System - 12 Months
1324455Kiosk and Exeloo at Joynton Park - ZetlandHeight Safety System - 12 Months
1424456East Sydney Community and Arts Centre (ESCAC)Height Safety System - 12 Months
1524457Perry Park Recreation CentreHeight Safety System - 12 Months
1624458Darlington Activity CentreHeight Safety System - 12 Months
1724459Hilda Booler Child Care CentreHeight Safety System - 12 Months
1824460Nurses QuartersHeight Safety System - 12 Months
1924461Andrew Boy Charlton PoolHeight Safety System - 12 Months
2024462Cafe - Hyde Park SouthHeight Safety System - 12 Months
2124463410-416 Sydney Park Rd - Cycling Cnt - Sydney ParkHeight Safety System - 12 Months
2224464Broughton Street KindergartenHeight Safety System - 12 Months
2324572Depot - Cumberland StreetHeight Safety System - 12 Months
2424573Breezeway 8/9 Passageway with overhead roofHeight Safety System - 12 Months
2524481City Recital HallHeight Safety System - 12 Months
2624482101-111 William StreetHeight Safety System - 12 Months
2724483Commonwealth Bank BuildingHeight Safety System - 12 Months
2824484343 George StreetHeight Safety System - 12 Months
2924485Goulburn Street Parking StationHeight Safety System - 12 Months
3024486Phillip Park Community & Childrens CentreHeight Safety System - 12 Months
3124487Known as Jane Evans Day CentreHeight Safety System - 12 Months
3224488Known as Jane Evans Day CentreHeight Safety System - 12 Months
3324598Coronation HotelHeight Safety System - 12 Months
3423866King George V Recreation CentreHeight Safety System - 12 Months
3524454Juanita Nielsen Community CentreHeight Safety System - 12 Months
3624455Gunyama Park Aquatics and Recreation CentreHeight Safety System - 12 Months
3724456Joynton Avenue Creative Centre (JACC)Gutters and Downpipes - 12M
3824457Sydney Town HallGutters and Downpipes - EWP Required - 12M
3924458Haymarket LibraryGutters and Downpipes - 12M
4024459Paddington Town HallGutters and Downpipes - 3M
4124460TabernacleGutters and Downpipes - 12M
4224461119 Redfern StreetGutters and Downpipes - 12M
4324462Joynton Avenue Creative Centre (JACC)Drains - 12M
4424463Sydney Town HallDrains - EWP Required - 12M
4524464Haymarket LibraryDrains - 12M
4624572Paddington Town HallDrains - 6M
4724573Ian Thorpe Aquatic CentreDrains - EWP Required - 3M
4824481TabernacleDrains - 12M
4924482119 Redfern StreetDrains - 12M
5024483St James CafeHeight Safety System - 12 Months
5124484Kings Cross Neighbourhood Service Centre & LibraryGutters and Downpipes - AWNING ONLY - 1M
5224485Kings Cross Neighbourhood Service Centre & LibraryGutters and Downpipes - AWNING ONLY - 1M
5324486Kings Cross Neighbourhood Service Centre & LibraryDrains - AWNING ONLY - 1M
5424487Kings Cross Neighbourhood Service Centre & LibraryDrains - AWNING ONLY - 1M
5524488171-203 Euston Rd - Public Toilet - Sydney ParkHeight Safety System - 12 Months
5624598Doody Street Industrial ComplexPriority 4-Roofing & Skylights
5723866107 Redfern StreetPriority 4-Interior Fixtures & Fittings Maintenance
5824454Green Square LibraryPriority 4-External-Fittings & Equipment
5924455PACT TheatrePriority 4-Fall Arrest / Height Safety Equipment
6024456Paddington Town HallPriority 4-External-Fittings & Equipment
6124457TabernaclePriority 4-Fall Arrest / Height Safety Equipment
6224458Huntley Street Early Learning CentrePriority 4-Fall Arrest / Height Safety Equipment
Schedule Tracker



Below is a list of variations, along with the data triggers.
  • Schedule Tacker column E - First word "Height"
    • Excel Formula:
      =CONCAT(Schedule_Tracker[@[Job '#]], " - HSR Annual Inspection - ", Schedule_Tracker[@Building])
    • Example: 24481 - HSR Annual Inspection - St Helens Community Centre

  • Schedule Tacker column E - First word "Gutters"
    • Excel Formula:
      =CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building])
    • Example: 24458 - RA Gutters and Downpipes - 12M - Haymarket Library

  • Schedule Tacker column E - First word "Drains"
    • Excel Formula:
      =CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building])
    • Example: 24464 - RA Drains - 12M - Haymarket Library


Below is a copy of my Folder Names sheet.

Active Tasks.xlsx
A
1Folder Names
224481 - HSR Annual Inspection - St Helens Community Centre
324482 - HSR Annual Inspection - St James Park Tennis Courts and Clubhouse
424483 - HSR Annual Inspection - Public Toilets - Watson Road
524484 - HSR Annual Inspection - Town Hall House
624485 - HSR Annual Inspection - The Crescent Early Learning Centre
724486 - HSR Annual Inspection - Redfern Community Centre
824487 - HSR Annual Inspection - Public Toilets and Garden Shed -Bourke Street Park
924488 - HSR Annual Inspection - Public Toilet - 13A Refinery Drive
1024598 - HSR Annual Inspection - Huntley Street Early Learning Centre
1123866 - HSR Annual Inspection - Erskineville Town Hall
1224454 - HSR Annual Inspection - Erskineville Arts Centre
1324455 - HSR Annual Inspection - Kiosk and Exeloo at Joynton Park - Zetland
1424456 - HSR Annual Inspection - East Sydney Community and Arts Centre (ESCAC)
1524457 - HSR Annual Inspection - Perry Park Recreation Centre
1624458 - HSR Annual Inspection - Darlington Activity Centre
1724459 - HSR Annual Inspection - Hilda Booler Child Care Centre
1824460 - HSR Annual Inspection - Nurses Quarters
1924461 - HSR Annual Inspection - Andrew Boy Charlton Pool
2024462 - HSR Annual Inspection - Cafe - Hyde Park South
2124463 - HSR Annual Inspection - 410-416 Sydney Park Rd - Cycling Cnt - Sydney Park
2224464 - HSR Annual Inspection - Broughton Street Kindergarten
2324572 - HSR Annual Inspection - Depot - Cumberland Street
2424573 - HSR Annual Inspection - Breezeway 8/9 Passageway with overhead roof
2524481 - HSR Annual Inspection - City Recital Hall
2624482 - HSR Annual Inspection - 101-111 William Street
2724483 - HSR Annual Inspection - Commonwealth Bank Building
2824484 - HSR Annual Inspection - 343 George Street
2924485 - HSR Annual Inspection - Goulburn Street Parking Station
3024486 - HSR Annual Inspection - Phillip Park Community & Childrens Centre
3124487 - HSR Annual Inspection - Known as Jane Evans Day Centre
3224488 - HSR Annual Inspection - Known as Jane Evans Day Centre
3324598 - HSR Annual Inspection - Coronation Hotel
3423866 - HSR Annual Inspection - King George V Recreation Centre
3524454 - HSR Annual Inspection - Juanita Nielsen Community Centre
3624455 - HSR Annual Inspection - Gunyama Park Aquatics and Recreation Centre
3724456 - HSR Annual Inspection - Joynton Avenue Creative Centre (JACC)
3824457 - HSR Annual Inspection - Sydney Town Hall
3924458 - RA Gutters and Downpipes - 12M - Haymarket Library
4024459 - HSR Annual Inspection - Paddington Town Hall
4124460 - HSR Annual Inspection - Tabernacle
4224461 - HSR Annual Inspection - 119 Redfern Street
4324462 - HSR Annual Inspection - Joynton Avenue Creative Centre (JACC)
4424463 - HSR Annual Inspection - Sydney Town Hall
4524464 - RA Drains - 12M - Haymarket Library
4624572 - HSR Annual Inspection - Paddington Town Hall
4724573 - HSR Annual Inspection - Ian Thorpe Aquatic Centre
4824481 - HSR Annual Inspection - Tabernacle
4924482 - HSR Annual Inspection - 119 Redfern Street
5024483 - HSR Annual Inspection - St James Cafe
5124484 - HSR Annual Inspection - Kings Cross Neighbourhood Service Centre & Library
5224485 - HSR Annual Inspection - Kings Cross Neighbourhood Service Centre & Library
5324486 - HSR Annual Inspection - Kings Cross Neighbourhood Service Centre & Library
5424487 - HSR Annual Inspection - Kings Cross Neighbourhood Service Centre & Library
5524488 - HSR Annual Inspection - 171-203 Euston Rd - Public Toilet - Sydney Park
5624598 - HSR Annual Inspection - Doody Street Industrial Complex
5723866 - HSR Annual Inspection - 107 Redfern Street
5824454 - HSR Annual Inspection - Green Square Library
5924455 - HSR Annual Inspection - PACT Theatre
6024456 - HSR Annual Inspection - Paddington Town Hall
6124457 - HSR Annual Inspection - Tabernacle
6224458 - HSR Annual Inspection - Huntley Street Early Learning Centre
Folder Names
Cell Formulas
RangeFormula
A2:A38,A40:A44,A46:A62A2=CONCAT(Schedule_Tracker[@[Job '#]], " - HSR Annual Inspection - ", Schedule_Tracker[@Building])
A39,A45A39=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name]], " - ", Schedule_Tracker[@Building])





Any assistance with this formula will be greatly appreciated.

Many thanks,
Tim
 
For 365 (and I think 2021), and assuming there are not too many (if there are then an alternative to a nested IF would be recommended);
Excel Formula:
=IF(TEXTBEFORE(E2," ",1)="Height",CONCAT(Schedule_Tracker[@[Job '#]], " - HSR Annual Inspection - ", Schedule_Tracker[@Building]),IF(TEXTBEFORE(E2," ",1)="Gutters",=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building]),IF(TEXTBEFORE(E2," ",1)="Drains",=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building]),"Not found")))
 
Upvote 0
For 365 (and I think 2021), and assuming there are not too many (if there are then an alternative to a nested IF would be recommended);
Excel Formula:
=IF(TEXTBEFORE(E2," ",1)="Height",CONCAT(Schedule_Tracker[@[Job '#]], " - HSR Annual Inspection - ", Schedule_Tracker[@Building]),IF(TEXTBEFORE(E2," ",1)="Gutters",=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building]),IF(TEXTBEFORE(E2," ",1)="Drains",=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building]),"Not found")))

I entered the formula and substituted E2 for the correct reference on the Schedule Tracker sheet. However, it didn't recognise the formula.
Excel Formula:
=IF(TEXTBEFORE(Schedule_Tracker[@[Task Name]]," ",1)="Height",CONCAT(Schedule_Tracker[@[Job '#]], " - HSR Annual Inspection - ", Schedule_Tracker[@Building]), IF(TEXTBEFORE(Schedule_Tracker[@[Task Name]]," ",1)="Gutters",'Folder Name=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building])), IF(TEXTBEFORE(Schedule_Tracker[@[Task Name]]," ",1)="Drains",=CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name], " - ", Schedule_Tracker[@Building]),"Not found")))

Screenshot 2025-03-27 at 17.02.21.png


Any suggestions?
 
Upvote 0
A few misplaced brackets and equals signs. Try this:

Excel Formula:
=IF(TEXTBEFORE(Schedule_Tracker[@[Task Name]]," ",1)="Height",CONCAT(Schedule_Tracker[@[Job '#]], " - HSR Annual Inspection - ", Schedule_Tracker[@Building]),IF(TEXTBEFORE(E2," ",1)="Gutters",CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name]], " - ", Schedule_Tracker[@Building]),IF(TEXTBEFORE(E2," ",1)="Drains",CONCAT(Schedule_Tracker[@[Job '#]], " - RA ", Schedule_Tracker[@[Task Name]], " - ", Schedule_Tracker[@Building]),"Not found")))
 
Upvote 0
Solution
As an afterthought, this formula can be shortened to:
Excel Formula:
=LET(_tb,TEXTBEFORE(Schedule_Tracker[@[Task Name]]," ",1),_tex1,Schedule_Tracker[@[Job '#]],IF(_tb="Height",CONCAT(_tex1, " - HSR Annual Inspection - ", Schedule_Tracker[@Building]),IF(_tb="Gutters",CONCAT(_tex1, " - RA ", Schedule_Tracker[@[Task Name]], " - ", Schedule_Tracker[@Building]),IF(_tb="Drains",CONCAT(_tex1, " - RA ", Schedule_Tracker[@[Task Name]], " - ", Schedule_Tracker[@Building]),"Not found"))))

and further if the basic form for gutters and drains is meant to be the same (as it appears here) then it can be further shortened to:
Excel Formula:
=LET(_tb,TEXTBEFORE(Schedule_Tracker[@[Task Name]]," ",1),_tex1,Schedule_Tracker[@[Job '#]],IF(_tb="Height",CONCAT(_tex1, " - HSR Annual Inspection - ", Schedule_Tracker[@Building]),IF(OR(_tb="Gutters",_tb="Drains"),CONCAT(_tex1, " - RA ", Schedule_Tracker[@[Task Name]], " - ", Schedule_Tracker[@Building]),"Not found")))
 
Upvote 0
Another suggestion
  1. Make another column (called Folder) in the table with the shorter formula
    =LET(n,IFNA(MATCH(TEXTBEFORE([@[Task Name]]," "),{"Height","Gutters","Drains"},0),0),IF(n=0,"Not found",[@[Job '#]]&IF(n=1," - HSR Annual Inspection - "," - RA "&[@[Task Name]]&" - ")&[@Building]))

  2. If you still need the folders on the 'Folder Name' sheet just use the formula
    =Schedule_Tracker[Folder]
If you don't want the folder name showing on the 'Schedule Tracker' sheet then hide that column.
 
Upvote 0

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