Converting text into a numerical value is fairly straight-forward in Notion. A column of text and a formula result column is all you'll need. Translating one word into one number is easy, but I want to take this tutorial a step further. I'm also going to show you how to convert multiple text cells and/or columns into one numerical value. I use a worker's pay tracker as an example below. Let's begin with a simple one-to-one text to number formula:
We are going to convert the "Monday" tag into 13 hours. This requires the following IF Statement¹:
(prop("Day of Week") == "Monday") ? format(13) : ""
For one statement, "if" does not need to be implemented. The "?" symbol does this for you.
Next, let's string multiple text values under one column (or property) and translate them into corresponding numerical values.
if(prop("Day of Week") == "Monday", 13, if(prop("Day of Week") == "Tuesday", 12, if(prop("Day of Week") == "Wednesday", 12, if(prop("Day of Week") == "Thursday", 10, if(prop("Day of Week") == "Friday", 12, if(prop("Day of Week") == "Saturday", 15, if(prop("Day of Week") == "Sunday", 16, 0)))))))
This string of *IF Statements* is constructed a little differently. Instead of "?", a comma is used, and "if" is placed in front of the statement.
Now, let's add a *Clocked in* property. Our formula is going to determine IF "Day of Week" and "Clocked in", THEN result. Statements can be extended by using the “and” function.
if(prop("Day of Week") == "Monday" and prop("Clocked in") == true, 13, if(prop("Day of Week") == "Tuesday" and prop("Clocked in") == true, 12, if(prop("Day of Week") == "Wednesday" and prop("Clocked in") == true, 12, if(prop("Day of Week") == "Thursday" and prop("Clocked in") == true, 10, if(prop("Day of Week") == "Friday" and prop("Clocked in") == true, 12, if(prop("Day of Week") == "Saturday" and prop("Clocked in") == true, 15, if(prop("Day of Week") == "Sunday" and prop("Clocked in") == true, 16, 0)))))))
Lastly, let's determine pay altercations by *Night* and *Day* shift factors. In this example *Night* shift increases a worker's pay by .50 cents. For this, we are going to exit the *Hours* property and insert a new formula in *Pay.* The formula will be altered as follows:
if(prop("Shift Type") == "Day", 10.50 * prop("Hours"), if(prop("Shift Type") == "Night", 11.00 * prop("Hours"), 0))
Footnotes
IF Statement¹: A statement that calls for a solution *if* a particular condition is met.