12.1 Use formulas to handle association

 

Here below is an Excel file book1.xlsx, which stores employees’ meal data. Part of the data is as follows:

imagepng

The task is to calculate the values in column C according to the following pricing rules:

imagepng

Since there are only a few rows in this table, we can enumerate them in the formula directly. Enter in cell C2:

=spl("=case(?1,""breakfast"":10,""lunch"":15,""supper"":20)",B2)

imagepng

Then drag C2 down to every relevant row:

imagepng


https://c.scudata.com/article/1651916536524
https://c.scudata.com/article/1657248052531
https://c.scudata.com/article/1657352905527