Let’s break down our formatting into its individual parts for a better understanding:
1. [Red][>70] 0 “Piece” = The color value of the number is specified in the square brackets at the beginning, and in the second square bracket behind it we specify a condition for when this should be the case. Here the number should appear in red if the number is greater than 70. Next, we didn’t just want to have the pure number there, but the information “piece”. You can put text both before and after a number. So that Excel can calculate with it, you must ALWAYS put the text in “”!
2.;[Red][<=25] 0 “piece” = The first character we see is a semicolon. This is how we separate the sections within our conditional formatting code. You can use up to four sections within a format code, but you must always ensure that they are separated from one another with a semicolon so that the formatting works. So first we specify the color again, and then we specify the argument that this should be on condition that the number is less than or equal to 25.
3.;[Blue] 0 “Piece” = In the last section of our formatting, we specify that if none of the arguments mentioned above applies, the font should be blue, and of course our additional text “Piece”. If we left out the third section completely, Excel would only output the pure number in the default font color.
Note: In the screenshot above, you will have noticed that when you select cell C4, which says “71 pieces”, this information is not reflected in the formula bar. There is only the number 71. This is because by adding text in “” Excel can ignore this text and only look at the number. If we were to simply write 71 pieces into the cell without displaying this using formatting, Excel would treat the content of the cell as text. And you can’t calculate with text!