Ravindra BagaleCourses & study guides मराठी Track your progress

3. Formulas and Functions

Excel

3.8 Joining Text: &, CONCAT, TEXTJOIN and TEXT

Give the reader one line without losing separate fields

A teammate reviewing a fictional Blinkit delivery export asks for a one-line message with the order ID, city and rupee amount. The worksheet already has three useful fields. Keep them in their own columns so formulas can sort, match and add them. Create one extra column for the message so a person can read the same values without stepping across the sheet.

Use the ten-row Orders practice sheet in the chapter overview. The orders and values are fictional. They teach report layouts and describe no actual process inside Blinkit, Amazon Now or any other company. Order ID is A, the date is B, the city is C, and the numeric amount is G. In these examples, a formula reads those fields and returns a text string suitable for a note, review or title.

Decide which field is used for arithmetic

  • The amount kept in column G remains a number. A SUM elsewhere can still add it, and a numeric sort can still put larger orders first.
  • The message can contain currency symbols, separators and date words. That entire result is text. Keep calculation and sorting on the original numeric or date fields.
  • The same source row can yield different kinds of presentations. A short label might show the city and amount, and a longer label might add the order date. The original fields still define both.
The numeric value 1299 stays in its own amount field. TEXT shows 1,299 for the message, then the message joins BLK-1007, Solapur and the rupee value with separators.
Keep the calculation input in its own column. Format only the piece meant for the reader.

Select a joining method that matches your layout

Ampersand gives you control over each piece

Use =A2&" | "&C2 to put a separator between two fields. A2 supplies the order ID, the quoted string supplies a pipe with a space on both sides, and C2 supplies the city. For the first order, the result is BLK-1001 | Pune. The ampersands tell Excel to connect the preceding and following values. A literal, including separators and spaces, goes in double quotes. A cell address stays outside the quotation marks so Excel can read it.

CONCAT joins items and ranges

Use =CONCAT(A2," | ",C2) to ask a function to assemble the same three pieces. CONCAT can also take a reference to a range, which is useful when its values already make sense together without any separators. It does not add a delimiter automatically. A call such as =CONCAT("Pune","East") returns PuneEast. Supply an explicit separator or use a function designed to insert it.

Older workbooks may use CONCATENATE. It is supported for compatibility in many versions and joins the supplied arguments. In a shared workbook, confirm which functions collaborators can use. For a list of just a few explicit pieces, the ampersand offers a simple version-friendly choice. For structured range joins, check the current Microsoft function pages and the client's availability.

TEXTJOIN applies the same delimiter throughout

Use =TEXTJOIN(" | ",TRUE,A2,C2) when a common separator belongs between the included items. The first argument is the delimiter, the second governs whether empty items are ignored, and the remaining arguments are strings or references to join. A short sequence of optional fields is easier to read when you can put the shared delimiter in one place.

If the same report uses a delimiter stored in another cell, you can pass its reference as the first argument. An empty text delimiter joins pieces with nothing in between. With a space, a comma or another chosen marker, include any padding in that literal. Write the expected output with visible separators so another learner can inspect it character by character.

Make numbers and dates readable with TEXT

A number format can make 1299 display as ₹1,299. The underlying value still supplies 1299 for arithmetic. When Excel joins it to other text, it can use a generic text representation instead of reproducing the cell's format. TEXT(value,format_text) returns a formatted string so you can choose how that value appears in a message.

Build the amount piece before joining it

Try =TEXT(G8,"#,##0") on the Solapur order. With familiar English-style formatting this returns the text 1,299. The format uses grouping and a required units digit, displaying no decimal places. If a report needs two decimals, use a code such as "#,##0.00" for the illustrative configuration. It would show 1,299.00. Regional settings can determine the exact displayed separators and grouping patterns. Check against a value containing thousands and decimals before publishing a report relied on by readers in different locales.

Add a rupee symbol explicitly: ="₹"&TEXT(G8,"#,##0"). This controls which currency marker the phrase includes. It does not convert between currencies. Only use that marker when the source value already represents rupees, as it does in this exercise. For a mixed-currency report, preserve the source currency field and make conversion rules explicit elsewhere.

Build a calendar label from a real date

If B2 contains the date 2 November 2026, a plain concatenation of that date may show a serial number rather than the formatted day and month. The serial is how Excel represents the date as a number. Use =TEXT(B2,"dd-mmm-yyyy"). An English configuration displays 02-Nov-2026. A different language may display a different month abbreviation. To reduce ambiguity about whether 02 is a month or a day, include an agreed date pattern and verify the expected output in the target environment.

Keep the text result separate from the typed input

TEXT returns text even when the string consists of digits and punctuation. =ISTEXT(TEXT(G2,"0")) is TRUE. =ISNUMBER(G2) is also TRUE in the original dataset. These facts can hold at the same time. A later amount total should reference the numeric source instead of trying to recover numbers from complete labels that contain cities, dates and symbols.

Lab 1 · Build an order note from the typed data

Start with a clean copy of Orders. Make sure B contains actual Excel dates and G contains numeric rupee amounts. The examples use English month abbreviations and familiar comma grouping. Your locale can display punctuation or date words differently, so compare the intended fields rather than trying to change your global settings.

Write the short note first

  1. Put Message in J1. In J2 type =A2&" | "&C2&" | ₹"&TEXT(G2,"#,##0"). It returns BLK-1001 | Pune | ₹64. Read the expression aloud one piece at a time so the separator positions are clear.
  2. Fill J2 through J11. Inspect J3 and J8. Row 3 should show BLK-1002 | Nashik | ₹270. Row 8 should show BLK-1007 | Solapur | ₹1,299. The original amount in G8 remains numeric.
  3. In K1 type Order note with date. In K2 add the date with another delimiter: =J2&" | "&TEXT(B2,"dd-mmm-yyyy"). The intended date text is 02-Nov-2026 in the first row, given the English locale. Fill it down and use row 8 to verify the 05-Nov-2026 date.
  4. Try the alternative =TEXTJOIN(" | ",TRUE,A2,C2,"₹"&TEXT(G2,"#,##0"),TEXT(B2,"dd-mmm-yyyy")) in a spare cell. For this complete row it returns the same words, separators and amount. When you read an alternative formula, compare the full output with the original rather than only looking for the right currency number.
Compare the exact order identity, city, amount and date in each message.
Order rowShort messageAppended date
2BLK-1001 | Pune | ₹6402-Nov-2026
3BLK-1002 | Nashik | ₹27002-Nov-2026
8BLK-1007 | Solapur | ₹1,29905-Nov-2026

Prove the message changes with the amount

Temporarily change G8 from 1299 to 1305. Its messages update to show ₹1,305, and the amount total using =SUM(G2:G11) rises from ₹2,870 to ₹2,876. The city, ID and date in those messages stay the same. Restore 1299 after you verify the exact change. This test proves that the message reads the current numeric source and that the amount formula can still add the original range.

If a future order may have a missing amount, decide how the note shows that state. In a scratch copy, test =IF(ISNUMBER(G2),"₹"&TEXT(G2,"#,##0"),"Amount needs review") as a separate amount-piece formula. Compare a truly empty G2, a number stored as text and numeric zero. The first two should get the review label. Numeric zero should show ₹0 when it is a confirmed valid value for the practice order.

Build the message in four decisions

  1. Read the original cells

    On row 8, A8 contains BLK-1007 and C8 contains Solapur. G8 is the amount 1299 as a number.

  2. Format the amount as a piece of text

    Apply TEXT with a grouping format in the message formula. The readable amount piece displays 1,299 in the example locale, with a rupee marker added to it.

  3. Insert the separators

    Join the ID, city and amount with the pipe and spaces. The separators are literal characters in the message.

  4. Check both purposes

    J8 reads BLK-1007 | Solapur | ₹1,299. G8 can still supply 1299 to a SUM because the TEXT calculation used a copy of its value.

Lab 2 · Decide what to do with an optional line

Build a fictional Swiggy-inspired pickup-label sheet, with three possible text fields on each row. Some locations have an extra short instruction and others have a genuinely empty middle cell. The label is for a person to read. Later in the exercise you will build another text version that keeps every field position for inspection.

In a new tab named Pickup, use A1 Area, B1 Detail and C1 City. Enter the three sample rows below. Leave B2 genuinely empty. On row 4, create one actual space by entering =" " in B4. That row helps you see what a display can hide.

The middle column exercises an actual empty cell, a visible instruction and a one-space string.
RowAreaDetailCity
2KothrudLeave emptyPune
3BanerGate 2Pune
4HadapsarOne spacePune
  1. In D2 enter =TEXTJOIN(" | ",TRUE,A2:C2). With the empty field skipped, the result is Kothrud | Pune. Fill D through row 4. With the visible detail present, row 3 shows Baner | Gate 2 | Pune.
  2. In E2 enter =TEXTJOIN(" | ",FALSE,A2:C2). This deliberately keeps the middle position even when it contains nothing. Row 2 yields Kothrud | | Pune. The two adjacent separators identify the position between area and city.
  3. Compare the row 4 result in D. Its second item holds a space, so it remains in the join even with TRUE. The result has two pipes. Inspect the raw detail with LEN and get one. A space-bearing value is not the same input as B2's genuinely empty cell.
  4. Temporarily clear B4. D4 should now have just one pipe and read Hadapsar | Pune. If you clean imported labels in a real workbook, decide whether to skip an empty result or use a review message. Test that decision with the exact input types you expect.
  5. Return B4 to its original state if you want to keep the fixture. In a spare cell, test =TEXTJOIN(CHAR(10),TRUE,A3:C3). If you enable Wrap Text and give the cell sufficient height, Baner, Gate 2 and Pune appear on separate lines. This is a different display using the same fields and one newline delimiter.
The pickup fields are Kothrud, empty, and Pune. Ignoring an empty value gives one pipe between Kothrud and Pune; preserving positions uses two pipes.
An empty optional field can disappear from a human-readable label. Keep the position when the later task needs to inspect it.

Choose the blank-field policy before you connect pieces

A human-readable address can skip a line that adds no information. A line intended for later parsing may need to preserve the position of a missing field. Check who or what will read the output. The two pickup results from Lab 2 look similar and have different numbers of separators. That difference matters when the reader needs to know whether there were two source fields or three with one missing.

Skip optional content for a reader

A short dispatch note may use =TEXTJOIN(", ",TRUE,A2:C2) on the Pickup sheet. The resulting Kothrud, Pune is easy to use. A genuinely empty Detail cell adds no dangling punctuation. The reserved area and city remain separate original columns, so the report can still filter by either one.

Keep positions for an established layout

Use FALSE for the three-field pickup view if the audience must see the middle position even when it is empty. You can also choose an explicit text label such as No detail supplied. An explicit value is useful when a human should follow up. It also differs in meaning from a truly absent field. If you add a placeholder, test how a downstream system distinguishes it from an actual detail containing those words.

Check whitespace and empty-looking formulas directly

A text value with one ordinary space can look empty while still contributing to a result. That is why D4 in Lab 2 shows two pipes before clearing B4. Separate the state of the input from what you want to show. An error value is another state. It can stop a joining formula from returning a message. Inspect the specific faulty field and decide how to report it instead of replacing every error with an empty string.

With a reused report, create a short test list with a truly empty cell, an intentional space and a formula that returns empty text. Inspect the exact output and choose a policy for each state. You can make the business choice explicit before joining by testing the approved field or constructing a named display piece. This keeps the join predictable when a formula or import changes the representation of missing data.

Create a report title with a checked date and total

Use the original ten-row Orders fixture. Suppose you are preparing a fictional weekly export for a teammate to open later. Use a fixed export date field rather than a function that reads today's date, because the title should document the date you recorded for this export. Keep the total calculation in its own numeric cell and let the title read it.

  1. In L1 type Export date. In L2 enter =DATE(2026,11,8) as the stated fictional export date. Use sufficient space beside the worksheet to keep this setting visible.
  2. In M1 type All listed amounts. In M2 enter =SUM(G2:G11) and verify 2870. This is the gross listed amount across the whole ten-row fixture, including orders of all statuses.
  3. In another cell type ="Orders export dated "&TEXT(L2,"dd-mmm-yyyy")&" | all listed amounts: ₹"&TEXT(M2,"#,##0"). It gives the words Orders export dated 08-Nov-2026 followed by the all-listed-amounts label and ₹2,870 for the example locale.
  4. Temporarily change the export label date to 9 November. The title's date changes. The sum remains 2870 because the amount formula has no date filter. The heading says export dated, which is a label for the report. If you need “orders through this date,” the numeric total must actually apply that date condition.
  5. Restore 8 November after the test. Compare the typed date with any current-date label you might add using TODAY. TODAY is useful for a live “opened on” or current-day display. A formula that recalculates with the current date cannot be relied on to preserve a fixed historical export stamp.

Make a calculated label and a saved snapshot deliberate

If another system asks for the text from the title rather than the formula, copy the approved result into a separate output using a values-only operation. A values-only copy freezes the visible constructed string. It no longer recalculates as the order source changes. Keep the working date and sum on the workbook that produced the title, so you can rebuild it later.

Write the unit and selection in the message. “All listed amounts” tells a reader what to expect from 2,870. A phrase such as “total delivered sales” would use the same joining syntax, but its source amount cell should contain the separately verified delivered total of 2,215. The text should describe the calculation it actually reads.

Join a list without changing the number of source records

Text joining is often useful for printing a readable list of filters or choices. Start with the Categories column E in the Orders fixture. Some categories occur more than once. A plain =TEXTJOIN(", ",TRUE,E2:E11) keeps repeats because it joins source values in order. This is correct when a reader wants one text item per order.

Prepare distinct categories for a different question

When the request is “Which categories appear?”, first create the distinct list. In a supported dynamic-array version, try =UNIQUE(E2:E11) in a spare area large enough for the result. A dynamic array can return multiple results from one formula. Excel fills those results into neighboring grid cells through spilling. For the original fixture the distinct choices are Dairy, Fruits, Snacks, Bakery, Home and Staples. Check the output as a list before you put it inside another function.

Now try =TEXTJOIN(", ",TRUE,UNIQUE(E2:E11)) in a different spare cell. The inner operation produces a list of distinct values. The outer operation supplies the delimiter and returns one text cell. The expected joined label is Dairy, Fruits, Snacks, Bakery, Home, Staples on the original sample. For clients that do not recognize UNIQUE, prepare and verify a separate list of distinct labels using supported tools before joining it.

  • If a report expects alphabetical categories, sort the distinct list explicitly using a supported method. Resolving duplicates and controlling order are different operations.
  • If the source contains a spelling variation or a space-bearing label, clean the category according to its policy before deriving distinct values. A text join preserves whatever distinct list it receives.
  • Keep the list readable. A single long cell can become difficult to scan even before the function limit is reached. Microsoft documents a cell length limit of 32,767 characters for TEXTJOIN results. If you need to inspect many records, keep a structured list or split the output into logical groups.

Choose a separator with the downstream use in mind

Suppose two fields are Area and Detail. Joining them without a separator can make different pairs produce identical text. Put Pune and East in adjacent cells and concatenate. The result is PuneEast. Put Pun and eEast in another row. The combined result is also PuneEast. A readable-looking string cannot always tell a reader how to divide it into its source parts.

Use a deliberate boundary if the parts need to stay identifiable

Use a pipe in the middle, for example =A2&" | "&B2. It gives Pune | East for the first pair and Pun | eEast for the second. By inspection you can see why one pair differs from the other. Before using the technique as a machine key, also verify whether a source field can itself contain a pipe. If it can, establish a documented escaping rule or keep the fields separate as a structured dataset.

Imagine Detail contains Black | Blue as a legitimate product variant. A joined display such as Bag | Black | Blue can be clear to someone who recognizes the product. A generic split on the pipe would see three fields, despite having generated the label from only two source cells. This is a layout question. Joining does not automatically escape punctuation or record original field boundaries for later parsing.

  • Choose a delimiter that a reader recognizes and show it in the example output. Use spaces within a delimiter when they aid readability.
  • A joining formula can have the intended effect even when the result contains the delimiter as part of a source value. If you need to split reversibly, test that input before choosing a layout.
  • For CSV interchange, use a proper exporter with quoting rules or leave the source columns available. A comma joined by a worksheet function does not automatically escape commas already inside fields.
  • A date-and-amount note is a display string. Sorting the text may not produce the same order as sorting the original date and amount columns numerically.

Practice extension · format IDs, rates and dates deliberately

Set a minimum width for a new synthetic label

In a separate scratch sheet, put the number 7 in A2. In B2 enter =TEXT(A2,"0000"). The result is 0007, with four characters. This is a way to build a new four-character display label from a known numeric sequence. Join it with a code prefix using ="ORD-"&B2 to get ORD-0007. If you instead join A2 directly, you get ORD-7.

Change the input to 12345. The same format shows 12345 because the zeros specify a minimum place display and do not truncate extra integer digits. If the source specifies exactly four digits, check the allowed numeric range before using the label. For an imported original code, preserve the original text. A display format cannot restore a removed zero unless you already know the intended width.

Display a rate without changing its arithmetic value

In a new example, the numeric response rate in C2 is 0.05325. The formula ="Response rate "&TEXT(C2,"0.0%") displays Response rate 5.3% under the example formatting. The percent symbol in the format describes the standard hundredfold display of the fraction. It also asks for one decimal after conversion. C2 keeps its original numeric value for a later arithmetic comparison.

Appending a percent sign manually after concatenating the raw number would label it 0.05325%, a different rate. In a test copy, compare both messages. When your audience reads one as an amount or a rate, the unit and scaling must both be clear. Preserve the source fraction instead of using the joined string in a condition.

Check a timestamp's time format before joining

For a fictional service note, enter =DATE(2026,11,2)+TIME(14,30,0) in D2. Use =TEXT(D2,"dd-mmm-yyyy hh:mm") to prepare the example output 02-Nov-2026 14:30 in an English configuration. You can prepend a label such as Pickup planned at. The format describes which calendar and time parts should appear. The original date-time value remains available for duration and schedule calculations.

Test a morning and an afternoon. A format with an AM/PM marker can display a twelve-hour clock, while a format without it can display the twenty-four-hour style. Choose the one your readers understand and test it on a known value. If a message combines local times from multiple areas, the source also needs a trusted time-zone policy. A text format alone cannot supply the missing context.

Diagnose one piece before rebuilding the message

When the output looks wrong, split the formula mentally into its input pieces. Check one amount or time, then the actual join. A problem in a date field can be masked by a very attractive message layout. The same diagnostic method applies when a long report contains several formatted values.

  • Extra or missing punctuation. Type the literal delimiter in one place and check its leading and trailing spaces. If you supplied TRUE with an empty item, the expected item and its separator can disappear from the compact result.
  • A numeric-looking date. Inspect the source. If it is an actual date, use a date-related TEXT code in the join. If it is a date-like string, verify its source format and type before trying to format it numerically.
  • A larger amount looks like a plain digit string. Inspect the TEXT format and the numeric input, and test grouping with a value greater than 999. Width and separators differ by locale. The value can be correct while the string's punctuation differs.
  • A leading zero disappears. Decide whether you are handling a literal identifier or building a fixed-width display from a number. Preserve the original identifier as text where appropriate. A new display width belongs in its own formatted result.
  • The message is an error. Check the first invalid source expression, such as an error cell or a format the client does not accept. Test the pieces independently before suppressing the whole error. If you intentionally report a missing field, give it a scoped label.
  • The formula will not open in another client. Check the function's published support and the actual version or update channel in use. The ampersand with simple pieces is often a suitable compatibility fallback. You can still compute explicit blanks and dates as helpers where the client supports them.

One useful test is to keep the amount text, calendar text and separator in temporary cells until the message is correct. Compare every piece with the known source row. Then combine the expressions once you can read the expected result. A short error report from a teammate can name the exact component and row rather than saying the whole note is broken.

For a repeatable check, write the expected first message independently in another cell. Its ID has eight characters, the city has four, and the amount piece has three including the rupee symbol. The two spaces-and-pipe delimiters add six characters altogether, so the message length is twenty-one. Use LEN and EXACT to confirm the result even if a viewer cannot see an extra space on screen.

Check the sign and readability of an amount label

Make an express rule for credits and refunds when a practice report includes signed amounts. A negative value represents a reduction to the recorded figure under this exercise rule. Put -64 in A2 on a scratch worksheet and build a message piece using ="₹"&TEXT(A2,"#,##0"). The sample English configuration shows ₹-64. A teammate may want the sign before the currency symbol for this particular report.

Try =IF(A2<0,"-₹"&TEXT(ABS(A2),"#,##0"),"₹"&TEXT(A2,"#,##0")) on the checked numeric fixture. ABS supplies the magnitude as a positive number. For the negative branch, the prefix explicitly supplies the minus sign and currency marker before the digits. The positive branch only adds the marker. With -64 it shows -₹64, with 64 it shows ₹64, and with numeric zero it shows ₹0. The numeric source continues to carry its original sign.

  1. Decide how the display says an amount is unknown. Use a type or availability check before the sign formula if missing entries are permitted. A cancelled or incomplete row can be presented with a name describing its state without inventing a negative value.
  2. Keep the original zero and negative test rows available. A heading such as Net adjustment (₹) tells the reader how to interpret the label when the sign is important.
  3. Inspect the label inside a full message rather than only in isolation. The source ID in the order note already contains a hyphen. A visible field separator makes clear which minus sign belongs to the amount.
  4. Try adding two source amounts such as 64 and -64 in their numeric cells. They sum to zero even if the presentation labels use different punctuation. This helps confirm that your formatting has changed only the displayed string used for the report.

A small fixture with positive, negative, zero and missing cases will explain more than a long list of ordinary paid orders. Retain those tests when another colleague requests a change in the display format.

Quiz · predict the exact text

What does =CONCAT("Pune","East") return?

It returns PuneEast. CONCAT joins the items without adding a separator. Supply a separate string with a space, or use TEXTJOIN when the same delimiter belongs between all items.

What changes when TEXTJOIN skips an empty pickup field?

The middle empty item does not appear. Kothrud and Pune receive one separator between them. Keeping all positions uses two separators and shows where the empty item belongs.

Does the space-only Detail on row 4 behave like an empty cell?

It contains a character, so it is still part of the joined result. LEN of that detail is one. Inspect the spaces and choose a cleanup or explicit blank policy before building the output.

Why use TEXT on the amount before joining it?

It specifies the display of the amount piece, such as 1,299 instead of 1299. The result is text. The source remains numeric so the workbook can sum it.

Should a final archived export title use TODAY to preserve the date?

Store the recorded export date or freeze the approved report title as a value in the archival copy. TODAY reads the current date upon recalculation and can change when a workbook is opened later.

Does TEXTJOIN remove repeated category names?

It joins the items it gets, including repeated values. Create and verify a distinct list first if the question is which categories appear. Then use a join on that list.

Interview practice · separate presentation from calculation

How do you choose between ampersand, CONCAT and TEXTJOIN?

I use the ampersand for a short expression where each literal needs a visible position. CONCAT can assemble explicit items and ranges with controlled separators. TEXTJOIN applies one delimiter and an empty-field policy to the pieces it receives.

How would you build a message with a date and total?

I would compute the total in one numeric result and keep a real date input. Then I would convert each piece into readable text with TEXT and join it with labels that explain the amount's population and unit.

Why can two different records collapse to the same joined label?

Without clear boundaries, different source pieces can produce the same sequence of characters. I would test a field containing the chosen delimiter and keep the original separate columns for machine use.

How would you show an optional field or a missing numeric value?

I would decide whether the reader needs a blank position, compact message or review label. For a missing number, I would check the source type before formatting it, because recorded zero is a valid numeric state in some datasets.

What would you test before sharing a formula across Excel environments?

I would verify function availability and number and date formats with representative inputs. A large amount checks grouping, and a date with a clear month abbreviation checks presentation. The original cells should retain their intended data types.

Six cards about joined labels

  • Ampersand Join selected pieces directly. Quote literal separators and leave cell addresses available for lookup.
  • CONCAT Joins items or ranges. Supply any separators you want.
  • TEXTJOIN Adds a common delimiter. Decide whether missing positions belong in the output.
  • TEXT Returns a formatted string for a number or date. Preserve the original value for formulas.
  • Field boundaries Choose the delimiter and test input containing it before promising reversible text.
  • Report state A formula changes when its inputs change. Save an approved values-only presentation when the date or label must stay fixed.

Continue with splitting text by a delimiter. The short joining guide contains additional examples with a small independent fixture.

Microsoft references

Continue practising: explore the existing Excel Task Hub for additional exercises.