Checking the logical condition

Checking the logical condition is done using the If-Then-Else structure. It starts with the command If, followed by a logical condition that is formed in the same way as in Excel. Next follows the command Then, aftwer which goes the part of the code to be executed if the condition is met. Optionally, Else command can be specified, followed by a part of the code that is executed if the condition is not met. The structure ends with an End If command, which is not necessary if there’s only one command after Then.

Current prices

The catalog is a list of items associated with prices that and, by rule, it should not be changed more than once a day. In practice it is formed by consecutive adding codes of items, dates and prices in the table. How to find the last (current) price? Although at first glance it seems simple, this can be a considerable brain teaser. Also, this is an excellent demonstration of the practical application of formulas containing arrays and one of the “recipes” you will surely like.

Testing a condition

Testing of the conditions is done so that, depending on its fulfillment, we will get different results. These can be some concrete values, but most often, depending on the fulfillment of conditions, we devise different formulas for calculating. It is possible to create multiple conditions (multi-branching) or as a condition to specify an index that determines which expression will be calculated. The following text will detail the logical functions for testing the conditions.