Skip to content

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:

FunctionPurpose
dvdConcatIFJoin the values of a range, with or without a condition.
dvdConcatIFSJoin the values of a range that meet several conditions.
dvdJoinIFMerge values matching one condition, optionally removing duplicates.
dvdJoinIFSMerge values matching several range/criteria pairs.
dvdTextJoinJoin several texts or ranges with one delimiter.
dvdTextSplitItemReturn the nth item after splitting a string by a delimiter.
dvdExtractElementExtract the nth element of a string, keeping empty elements.
dvdCountOccurrencesCount how often a substring occurs in a string.
dvdWordCountCount the words in a string.
dvdUnDiacriticsViStrip Vietnamese diacritics.
dvdUniConvertConvert VNI or Telex typing into Vietnamese Unicode.
dvdUniVbaTurn a Vietnamese string into a VBA string expression.
dvdSymbolInsert a check-box symbol (empty / ticked / crossed).
dvdEvaluateEvaluate 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])
ParameterRequiredDescription
DelimiterYesSeparator placed between the joined values.
ConcatRangeYesRange of cells whose values are joined.
ConditionRangeNoRange holding the values compared against the condition.
ConditionNoCriteria 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:C40

Notes

  • ConditionRange and Condition must 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…)
ParameterRequiredDescription
DelimiterYesSeparator placed between the joined values.
ConcatRangeYesRange of cells whose values are joined.
ConditionsYesRange / 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])
ParameterRequiredDescription
CriteriaRangeYesRange holding the criteria used to filter the data.
ConditionYesValue to filter on.
ConcatenateRangeYesRange of values to merge.
SeparatorNoSeparator, ", " by default.
RemoveDuplicateNoTRUE removes duplicate values, FALSE by default.
ShowConditionNoTRUE 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 use dvdConcatIF.
  • CriteriaRange and ConcatenateRange must 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…)
ParameterRequiredDescription
SeparatorYesSeparator; leave it empty to use ", ".
RemoveDuplicateYesTRUE removes duplicate values.
ConcatenateRangeYesRange of values to merge.
PairsYesRange / 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

  • Pairs must contain an even number of arguments and every criteria range must match the size of ConcatenateRange, 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…)
ParameterRequiredDescription
DelimiterYesSeparator placed between the text values.
IgnoreEmptyYesTRUE skips empty values.
TextYesValues 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])
ParameterRequiredDescription
InputTextYesSource string to split.
DelimiterYesSeparating character or string.
IndexYesPosition of the item, starting at 1.
IgnoreEmptyNoTRUE 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)
ParameterRequiredDescription
InputStringYesString to extract the element from.
ElementNumberYesPosition of the element, starting at 1.
SeparatorYesSeparating 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)
ParameterRequiredDescription
MainTextYesText to search in.
SubTextYesText 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)
ParameterRequiredDescription
TextYesText whose words are counted.

Example:

=dvdWordCount("Bê tông lót móng M1")
// → 5

dvdUnDiacriticsVi

Strips Vietnamese diacritics from a string, leaving every other character unchanged.

Syntax:

=dvdUnDiacriticsVi(sContent)
ParameterRequiredDescription
sContentYesVietnamese 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)
ParameterRequiredDescription
TextYesText to convert.
InputMethodYesInput method of the source text: "VNI" or "Telex".

Example:

=dvdUniConvert("Be6 to6ng"; "VNI")
// → "Bê tông"

=dvdUniConvert("Bee toong"; "Telex")
// → "Bê tông"

Notes

  • InputMethod only 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)
ParameterRequiredDescription
TxtUniYesVietnamese 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)
ParameterRequiredDescription
valueYes1 = empty box, 2 = ticked box, 3 = crossed box.

Example:

=dvdSymbol(2)
// → ☑

=dvdSymbol(IF(D6="Đạt"; 2; 3))
// → ☑ when the check passed, ☒ when it failed

Notes

  • 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)
ParameterRequiredDescription
InputStringYesSource 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.75

Notes

  • Everything from the = sign onwards is discarded, so a description like "Móng M1: 2x3x0.8 = 4.8" still evaluates correctly.
  • x and X are read as multiplication signs and spaces are removed.
  • An invalid expression, or a result of zero, returns an empty string.

Released under DVDAddin License.