Text functions
This group contains 14 string-handling functions: joining the values of a range (with or without conditions), splitting strings and extracting elements, counting words and occurrences, Vietnamese-specific helpers (strip diacritics, VNI/Telex, Unicode strings for VBA) and a quick evaluator for quantity expressions written inside a description cell.
The examples below use a semicolon ; to separate arguments (Excel running on a Vietnamese regional format). If your Excel uses the English (US) format, type a comma , instead of ;.
Quick reference:
| Function | Purpose |
|---|---|
dvdConcatIF | Join the values of a range, with or without a condition. |
dvdConcatIFS | Join the values of a range that meet several conditions. |
dvdJoinIF | Merge values matching one condition, optionally removing duplicates. |
dvdJoinIFS | Merge values matching several range/criteria pairs. |
dvdTextJoin | Join several texts or ranges with one delimiter. |
dvdTextSplitItem | Return the nth item after splitting a string by a delimiter. |
dvdExtractElement | Extract the nth element of a string, keeping empty elements. |
dvdCountOccurrences | Count how often a substring occurs in a string. |
dvdWordCount | Count the words in a string. |
dvdUnDiacriticsVi | Strip Vietnamese diacritics. |
dvdUniConvert | Convert VNI or Telex typing into Vietnamese Unicode. |
dvdUniVba | Turn a Vietnamese string into a VBA string expression. |
dvdSymbol | Insert a check-box symbol (empty / ticked / crossed). |
dvdEvaluate | Evaluate the maths expression written after a colon in a string. |
dvdConcatIF
Joins the values of a range into one string; when a condition range is supplied, only the matching rows are joined.
Syntax:
=dvdConcatIF(Delimiter; ConcatRange; [ConditionRange]; [Condition])| Parameter | Required | Description |
|---|---|---|
Delimiter | Yes | Separator placed between the joined values. |
ConcatRange | Yes | Range of cells whose values are joined. |
ConditionRange | No | Range holding the values compared against the condition. |
Condition | No | Criteria value; accepts operators (">5", ">=2", "<>0") and wildcards ("BT*"). |
Example:
=dvdConcatIF(", "; C6:C40; B6:B40; "Móng")
// → "Bê tông lót M100, Bê tông móng M300, Cốt thép móng"
=dvdConcatIF(" + "; C6:C40)
// → joins every non-empty work item in C6:C40Notes
ConditionRangeandConditionmust be supplied together; if either is missing the whole range is joined.- When no condition is given, empty cells are skipped.
dvdConcatIFS
Joins the values of a range that satisfy several conditions at once, each condition being a range/criteria pair.
Syntax:
=dvdConcatIFS(Delimiter; ConcatRange; Conditions…)| Parameter | Required | Description |
|---|---|---|
Delimiter | Yes | Separator placed between the joined values. |
ConcatRange | Yes | Range of cells whose values are joined. |
Conditions | Yes | Range / criteria pairs, listed one after another and repeated as often as needed. |
Example:
=dvdConcatIFS(", "; C6:C60; B6:B60; "Móng"; E6:E60; ">0")
// → "Bê tông móng M300, Cốt thép móng" (foundation items that carry a quantity)Notes
- Criteria use the same syntax as
dvdConcatIF: comparison operators or wildcards. - Condition ranges should hold as many cells as
ConcatRange; rows beyond the end of a condition range are dropped.
dvdJoinIF
Merges the values of a range whose criteria column matches a given value exactly, optionally removing duplicates and prefixing the result with the condition.
Syntax:
=dvdJoinIF(CriteriaRange; Condition; ConcatenateRange; [Separator]; [RemoveDuplicate]; [ShowCondition])| Parameter | Required | Description |
|---|---|---|
CriteriaRange | Yes | Range holding the criteria used to filter the data. |
Condition | Yes | Value to filter on. |
ConcatenateRange | Yes | Range of values to merge. |
Separator | No | Separator, ", " by default. |
RemoveDuplicate | No | TRUE removes duplicate values, FALSE by default. |
ShowCondition | No | TRUE prefixes the result with the condition and a colon. |
Example:
=dvdJoinIF(B6:B60; "Tầng 3"; C6:C60; " + "; TRUE; TRUE)
// → "Tầng 3: Cột C1 + Dầm D2 + Sàn S1"
=dvdJoinIF(D6:D60; "Đạt"; A6:A60)
// → "BB-01, BB-04, BB-07" (numbers of the approved acceptance records)Notes
- The match is exact — no operators, no wildcards. For
">5"or"BT*"style criteria usedvdConcatIF. CriteriaRangeandConcatenateRangemust contain the same number of cells, otherwise the function returns#REF!.
dvdJoinIFS
Merges the values of a range that satisfy several range/criteria pairs at once.
Syntax:
=dvdJoinIFS(Separator; RemoveDuplicate; ConcatenateRange; Pairs…)| Parameter | Required | Description |
|---|---|---|
Separator | Yes | Separator; leave it empty to use ", ". |
RemoveDuplicate | Yes | TRUE removes duplicate values. |
ConcatenateRange | Yes | Range of values to merge. |
Pairs | Yes | Range / criteria pairs, listed one after another and repeated as often as needed. |
Example:
=dvdJoinIFS(" + "; TRUE; C6:C60; B6:B60; "Tầng 3"; E6:E60; ">0")
// → "Cột C1 + Dầm D2 + Sàn S1"Notes
Pairsmust contain an even number of arguments and every criteria range must match the size ofConcatenateRange, otherwise the function returns#REF!.- Criteria accept comparison operators and wildcards, like
dvdConcatIF.
dvdTextJoin
Joins several values or ranges with one delimiter, optionally skipping empty cells.
Syntax:
=dvdTextJoin(Delimiter; IgnoreEmpty; Text…)| Parameter | Required | Description |
|---|---|---|
Delimiter | Yes | Separator placed between the text values. |
IgnoreEmpty | Yes | TRUE skips empty values. |
Text | Yes | Values or ranges to join; several arguments may be given. |
Example:
=dvdTextJoin("; "; TRUE; B6:B12; "Phát sinh ngoài hợp đồng")
// → "Cột C1; Dầm D2; Sàn S1; Phát sinh ngoài hợp đồng"dvdTextSplitItem
Splits a string by a delimiter and returns the item at the given position.
Syntax:
=dvdTextSplitItem(InputText; Delimiter; Index; [IgnoreEmpty])| Parameter | Required | Description |
|---|---|---|
InputText | Yes | Source string to split. |
Delimiter | Yes | Separating character or string. |
Index | Yes | Position of the item, starting at 1. |
IgnoreEmpty | No | TRUE skips empty items, TRUE by default. |
Example:
=dvdTextSplitItem("MB-T3-D1"; "-"; 2)
// → "T3"
=dvdTextSplitItem(A6; "/"; 3)
// → "Móng M1" (from the work code "HM01/BT/Móng M1")Notes
- A position beyond the last item returns an empty string rather than an error.
dvdExtractElement
Extracts the nth element of a string using the given separator, keeping empty elements in the count.
Syntax:
=dvdExtractElement(InputString; ElementNumber; Separator)| Parameter | Required | Description |
|---|---|---|
InputString | Yes | String to extract the element from. |
ElementNumber | Yes | Position of the element, starting at 1. |
Separator | Yes | Separating character or string. |
Example:
=dvdExtractElement("Bê tông/M300/Móng M1"; 2; "/")
// → "M300"
=dvdExtractElement(B6; 1; ",")
// → "Cột C1" (first item of the list stored in B6)Notes
- Unlike
dvdTextSplitItem, empty elements are counted, so in"A//B"the second element is an empty string.
dvdCountOccurrences
Counts how many times a substring occurs inside a string.
Syntax:
=dvdCountOccurrences(MainText; SubText)| Parameter | Required | Description |
|---|---|---|
MainText | Yes | Text to search in. |
SubText | Yes | Text whose occurrences are counted. |
Example:
=dvdCountOccurrences("Tầng 1;Tầng 2;Tầng 3"; ";") + 1
// → 3 (number of items in a semicolon-separated list)
=dvdCountOccurrences(C6; "D")
// → 4 (number of rebar marks "D" in a member note)Notes
- The comparison is case-sensitive.
dvdWordCount
Counts the words in a text string.
Syntax:
=dvdWordCount(Text)| Parameter | Required | Description |
|---|---|---|
Text | Yes | Text whose words are counted. |
Example:
=dvdWordCount("Bê tông lót móng M1")
// → 5dvdUnDiacriticsVi
Strips Vietnamese diacritics from a string, leaving every other character unchanged.
Syntax:
=dvdUnDiacriticsVi(sContent)| Parameter | Required | Description |
|---|---|---|
sContent | Yes | Vietnamese Unicode string to strip. |
Example:
=dvdUnDiacriticsVi("Bê tông cốt thép")
// → "Be tong cot thep"
=dvdUnDiacriticsVi(A6)
// → "Bien ban nghiem thu Mong M1" (useful for document file names)dvdUniConvert
Converts text typed with the VNI or Telex input method into Vietnamese Unicode.
Syntax:
=dvdUniConvert(Text; InputMethod)| Parameter | Required | Description |
|---|---|---|
Text | Yes | Text to convert. |
InputMethod | Yes | Input method of the source text: "VNI" or "Telex". |
Example:
=dvdUniConvert("Be6 to6ng"; "VNI")
// → "Bê tông"
=dvdUniConvert("Bee toong"; "Telex")
// → "Bê tông"Notes
InputMethodonly accepts"VNI"or"Telex"; any other value returns the original text unchanged.
dvdUniVba
Turns a Vietnamese string into a VBA string expression, writing accented characters as ChrW(...).
Syntax:
=dvdUniVba(TxtUni)| Parameter | Required | Description |
|---|---|---|
TxtUni | Yes | Vietnamese Unicode string to convert. |
Example:
=dvdUniVba("Nghiệm thu")
// → "Nghi" & ChrW(7879) & "m thu"Notes
- Handy when writing VBA macros for document templates: paste the result straight into the code so the text survives being saved as a .bas file.
dvdSymbol
Returns a check-box symbol for inspection and acceptance forms.
Syntax:
=dvdSymbol(value)| Parameter | Required | Description |
|---|---|---|
value | Yes | 1 = empty box, 2 = ticked box, 3 = crossed box. |
Example:
=dvdSymbol(2)
// → ☑
=dvdSymbol(IF(D6="Đạt"; 2; 3))
// → ☑ when the check passed, ☒ when it failedNotes
- Any value other than 1, 2 or 3 returns an empty string.
dvdEvaluate
Evaluates the maths expression written after a colon inside a quantity description.
Syntax:
=dvdEvaluate(InputString)| Parameter | Required | Description |
|---|---|---|
InputString | Yes | Source string containing the maths expression after a colon. |
Example:
=dvdEvaluate("Móng M1: 2x3x0.8")
// → 4.8
=dvdEvaluate("Dầm D1: 5*0.3*0.5")
// → 0.75Notes
- Everything from the
=sign onwards is discarded, so a description like"Móng M1: 2x3x0.8 = 4.8"still evaluates correctly. xandXare read as multiplication signs and spaces are removed.- An invalid expression, or a result of zero, returns an empty string.