Data type conversions
In the previous section, we tried to concatenate a text and number data type together, which produced an error message. The same thing happens when we try to add a date or a few other things as well. In this section, we will look at the different ways in which we can join various data types.
To join two different data types, we can use the Text.From
function. This function allows us to input a number, date, time, or even a binary value and it will return the numerical representation of that value. For example, if we type Text.From(7)
, it will give an answer of 7
. This, however, is not the number 7—it is text that represents the number 7. One thing to remember is that if the value is null, then Text.From
will also return null. We can use the Text.From
function to convert not only numbers, but also dates and times.
There are a number of different ways in which we can concatenate data using the ampersand operator (&
). In Excel, the easiest way to...