# Lookup Functions

An overview of lookup functions in the Advanced formula editor.

###### Table of contents

Formulas are at the core of Plecto. Every number that is displayed on a dashboard comes from a formula. With them, you can express a wide range of calculations that should be made on your data.

Formulas are saved as plain text, however, for it to work correctly it must follow a very specific syntax. You can think of it as a programming language. The language is similar to that of Excel or other spreadsheet software.

Your data in Excel are rows in a spreadsheet and you can filter and manipulate this data based on it's columns. Similarly in Plecto, registrations are the rows and fields are the columns.

### Available lookup functions

We will use the following table's data as examples in the below functions:

#### Count

Count(Data Source, <filters>)

The *Count* keyword tells Plecto to return the number of all registrations in the selected data source:

*Count(Example data) = 3*

#### Sum

Sum(Data Source, <filters>, Field)

The *Sum* keyword tells Plecto to return the sum of a given field of all registrations in the selected data source:

*Sum(Example data, Amount Sold) = 45 000*

#### First

First(Data Source, <filters>, Field)

The *First* keyword tells Plecto to return the first registration in the selected data source:

*First(Example data, Amount Sold) = 20 000*

#### Last

Last(Data Source, <filters>, Field)

The *Last* keyword tells Plecto to return the latest registration in the selected data source:

*Last(Example data, Amount Sold) = 15 000*

#### Avg

Avg(Data Source, <filters>, Field)

The *Avg* keyword tells Plecto to return the average of a given field of all registrations in the selected data source:

*Avg(Example data, Amount Sold) = 15 000*

#### Max

Max(Data Source, <filters>, Field)

The *Max* keyword tells Plecto to return the highest value of a given field of all registrations in the selected data source:

*Max(Example data, Amount Sold) = 20 000*

#### Min

Min(Data Source, <filters>, Field)

The *Min* keyword tells Plecto to return the lowest value of a given field of all registrations in the selected data source:

*Min(Example data, Amount Sold) = 10 000*