XLib


Download
Installation
X-VBA Home

Array
=AverageHigh
=AverageLow
=CountUnique
=IsInArray
=Large
=Reverse
=Small
=Sort
=SumHigh
=SumLow

Color
=Hex2Hsl
=Hex2Rgb
=Hsl2Hex
=Hsl2Rgb
=Rgb2Hex
=Rgb2Hsl
=Rgb2Hsv

DateTime
=DaysOfMonth
=MonthName2
=Quarter
=TimeConverter
=WeekOfMonth
=WeekdayName2

Environment
=ComputerName
=OS
=UserDomain
=UserName

File
=CountFiles
=CountFilesAndFolders
=CountFolders
=CurrentFilePath
=FileCreationTime
=FileDrive
=FileExtension
=FileFolder
=FileLastModifiedTime
=FileName
=FileSize
=FileType
=GetActivePath
=GetActivePathAndName
=GetFileNameByNumber
=PathJoin
=PathSeparator
=ReadFile
=WriteFile

Math
=Ceil
=Floor
=InterpolateNumber
=InterpolatePercent
=Max
=Min
=ModFloat

Meta
=XlibCredits
=XlibDocumentation
=XlibVersion

Network
=Http
=ParseHtmlString
=SimpleHttp

Random
=BigRandBetween
=RandBetween
=RandBetweens
=RandBool
=RandomRange
=RandomSample

Regex
=RegexReplace
=RegexSearch
=RegexTest

StringManipulation
=CamelCase
=Capitalize
=CompanyCase
=CountLowercaseCharacters
=CountUppercaseCharacters
=CountWords
=DedentText
=EliteCase
=Formatter
=InSplit
=IndentText
=KebabCase
=LeftFind
=LeftSearch
=LeftSplit
=RemoveCharacters
=Repeat
=ReverseText
=ReverseWords
=RightFind
=RightSearch
=RightSplit
=ScrambleCase
=ShortenText
=SplitText
=Substr
=SubstrFind
=SubstrSearch
=TextJoin
=TrimChar
=TrimLeft
=TrimRight
=Zfill

StringMetrics
=Damerau
=Hamming
=Levenshtein

Utilities
=BigDec2Hex
=BigHex
=Dec2Hex
=Hex2Dec
=HideText
=HtmlEscape
=HtmlUnescape
=JavaScript
=Jsonify
=Len2
=SpeakText
=UuidFour

Validators
=CreditCardName
=FormatCreditCard
=IsCreditCard
=IsEmail
=IsIPFour
=IsMacAddress
=IsPhone
=IsUrl

Array Module

This module contains a set of functions for manipulating and working with arrays.


=AverageHigh(array1, numberAveraged)

This function returns the average of the top values of the number specified in the second argument. For example, if the second argument is 3, only the top 3 values will be averaged

Arguments

{Variant}: array1   ➔   is the range that will be averaged

{Integer}: numberAveraged   ➔   is the number of the top values that will be averaged


Returns

{Variant}: Returns the average of the top numbers specified


Examples

  • =AverageHigh({1,2,3,4}, 2) -> 3.5; as 3 and 4 will be averaged
  • =AverageHigh({1,2,3,4}, 3) -> 3; as 2, 3, and 4 will be averaged

=AverageLow(array1, numberAveraged)

This function returns the average of the bottom values of the number specified in the second argument. For example, if the second argument is 3, only the bottom 3 values will be averaged

Arguments

{Variant}: array1   ➔   is the range that will be averaged

{Integer}: numberAveraged   ➔   is the number of the bottom values that will be averaged


Returns

{Variant}: Returns the average of the bottom numbers specified


Examples

  • =AverageLow({1,2,3,4}, 2) -> 1.5; as 1 and 2 will be averaged
  • =AverageLow({1,2,3,4}, 3) -> 2; as 1, 2, and 3 will be averaged

=CountUnique(array1)

This function counts the number of unique occurances of values within a range or multiple ranges

Arguments

{Variant}: array1()   ➔   is the group of cells we are counting the unique values of


Returns

{Variant}: Returns the number of unique values


Examples

  • =CountUnique(1, 2, 2, 3) -> 3;
  • =CountUnique("a", "a", "a") -> 1;
  • =CountUnique(arr) -> 3; Where arr = [1, 2, 4, 4, 1]

=IsInArray(value1, array1)

This function checks if a value is in an array

Arguments

{Variant}: value1   ➔   is the value that will be checked if its in the array

{Variant}: array1   ➔   is the array


Returns

{Boolean}: Returns boolean True if the value is in the array, and false otherwise


Examples

  • =IsInArray("hello", {"one", 2, "hello"}) -> True
  • =IsInArray("hello", {1, "two", "three"}) -> False

=Large(array1, nthNumber)

This function returns the nth highest number an in array, similar to Excel's LARGE function.

Arguments

{Variant}: array1   ➔   is the array that the number will be pulled from

{Integer}: nthNumber   ➔   is the number of the top value that will be chosen. For example, a nthNumber of 1 results in the 1st highest value being chosen, when a number of 2 results in the 2nd, etc.


Returns

{Variant}: Returns the nth highest number


Examples

  • =Large({1,2,3,4}, 1) -> 4
  • =Large({1,2,3,4}, 2) -> 3

=Reverse(array1)

This function takes an array and reverses all its elements

Arguments

{Variant}: array1   ➔   is the array that will be reversed


Returns

{Variant}: Returns the a reversed array


Examples

  • =Reverse({1,2,3}) -> {3,2,1}

=Small(array1, nthNumber)

This function returns the nth lowest number an in array, similar to Excel's SMALL function.

Arguments

{Variant}: array1   ➔   is the array that the number will be pulled from

{Integer}: nthNumber   ➔   is the number of the bottom value that will be chosen. For example, a nthNumber of 1 results in the 1st smallest value being chosen, when a number of 2 results in the 2nd, etc.


Returns

{Variant}: Returns the nth smallest number


Examples

  • =Small({1,2,3,4}, 1) -> 1
  • =Small({1,2,3,4}, 2) -> 2

=Sort(sortableArray, [descendingFlag])

This function is an implementation of Bubble Sort, allowing the user to sort an array, optionally allowing the user to specify the array to be sorted in descending order

Arguments

{Variant}: sortableArray   ➔   is the array that will be sorted

[(Optional) {Boolean}: descendingFlag]   ➔   changes the sort to descending


Returns

{Variant}: Returns the a sorted array


Examples

  • =Sort({1,3,2}) -> {1,2,3}
  • =Sort({1,3,2}, True) -> {3,2,1}

=SumHigh(array1, numberSummed)

This function returns the sum of the top values of the number specified in the second argument. For example, if the second argument is 3, only the top 3 values will be summed

Arguments

{Variant}: array1   ➔   is the range that will be summed

{Integer}: numberSummed   ➔   is the number of the top values that will be summed


Returns

{Variant}: Returns the sum of the top numbers specified


Examples

  • =SumHigh({1,2,3,4}, 2) -> 7; as 3 and 4 will be summed
  • =SumHigh({1,2,3,4}, 3) -> 9; as 2, 3, and 4 will be summed

=SumLow(array1, numberSummed)

This function returns the sum of the bottom values of the number specified in the second argument. For example, if the second argument is 3, only the bottom 3 values will be summed

Arguments

{Variant}: array1   ➔   is the range that will be summed

{Integer}: numberSummed   ➔   is the number of the bottom values that will be summed


Returns

{Variant}: Returns the sum of the bottom numbers specified


Examples

  • =SumLow({1,2,3,4}, 2) -> 3; as 1 and 2 will be summed
  • =SumLow({1,2,3,4}, 3) -> 6; as 1, 2, and 3 will be summed