Generating random dates and/or timestamps in Excel is the same as generating any other random number. Keep in mind that no matter how dates and/or timestamps are formatted and possibly edited, the underlying values saved in cells are decimal numbers. Number 1, formatted as a date, will represent January 1, 1900. 44.916 will represent December 21, 2022. 44.916,888111 will be representing December 21, 2022, at 9:18 PM. Date and/or time stamps should be generated between two dates (within a …
Category: Excel Functions
Cleaning up text in Excel: CLEAN, TRIM, and SUBSTITUTE
In Excel, you will occasionally deal with text fields containing line breaks, multiple spaces, hyphenation, currency and letterlike symbols, etc. This is common when dealing with unrestricted user-inputted data and can cause issues. In particular, these kinds of values will be hard to connect with related values without cleanup. When we MATCH those values with related data tables, errors are bound to occur. Basic cleanup approaches include manual replacement of all of the unnecessary characters with a desired or …
EOMONTH function: calculate past or future date from the starting date
You will sometimes need to calculate one date based on another date. Most often, you will need the first or last date of the current month, the first or last date of the current year, the previous or future month, year, quarter dates, etc. No matter what kind of dates you need, the simplest way to generate them will include the EOMONTH function. The EOMONTH function returns the last day of the month in relation to the start date. …
SUMIFS by text string length
Values that meet one or more criteria can be added up with the SUMIFS function. The sum of values next to cells containing specific text, i.e., a sum based on text criteria, is possibly the most common use case. The sum of values next to cells containing (non) specific text of a defined length (the defined number of characters in a text string) is a far less common need, but still crucial in specific situations. We can accomplish this …
UNICODE and UNICHAR functions
The Unicode Standard is the primarily used scheme for internal processing and storage of text, with almost 150 thousand code points representing characters. The Unicode Standard is supported in Excel. However, some functions for text manipulation still support only ASCII or ANSI character sets. Examples of those include the CLEAN function and the TRIM function. The CODE function and the CHAR function used for character manipulation also fall into that category. Full character manipulation is available through the UNICODE function and …
Combining INDIRECT with ADDRESS
We’ve previously covered how we can use any function to generate a text that could be a valid cell reference, both the column and row parts of the address, and then use the INDIRECT function to convert that text to a cell reference. This process can be greatly enhanced by the ADDRESS function. The ADDRESS function returns a text string that represents the address of a particular cell. Row, column, type of reference (locked or absolute), reference style (A1 …
INDIRECT function
The INDIRECT function returns the reference specified by a text string. The INDIRECT function syntax is as follows: = INDIRECT ( reference_text ; reference_style ) Reference text can be any text that the function can “convert” to a cell reference. Reference style represents the style of referencing cells in Excel. If omitted or TRUE, the reference text is interpreted as an A1 style reference, i.e., the default style of referencing cells in Excel. If FALSE, the reference text is interpreted …
How to MATCH numbers formatted as text in Excel
You will sometimes encounter issues while trying to MATCH or LOOKUP data in Excel if your numbers are formatted as numbers in one of your tables and as text in another table. While special formats are available in Excel, they are relatively rarely used and are limited. Some “numbers”, such as identification numbers, are more often stored as text. This is done in order to add leading zeros, hyphens, and other characters to those numbers. However, if we try to …
RANK functions
Ranking is a data transformation in which values are replaced by their rank when the data is sorted. For any two items, the first is either ranked higher than ranked lower than ranked equal to the second. Values can be ranked from the smallest to the largest, or from the largest to the smallest. Ordinal ranking presumes that all items will receive distinct ordinal numbers, including items that compare equally. Distinct ordinal numbers for items that are equal can …
SMALL & LARGE functions
The SMALL function returns the k-th smallest number from an array of numbers. The SMALL function syntax is as follows: = SMALL ( array; k ) Array can be any row, column, or a combination of both. k is an integer number representing the position of a number in the array if data in that array would be sorted from the smallest. Consider the following example: If k is 1, the smallest number will be returned. If k is …