# Lookup Functions

An overview of lookup functions in the Advanced formula editor.

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 them to work correctly, they 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. Where in Excel you have rows and columns, in Plecto we call them registrations and fields.

### Available lookup functions

We will use the following table to demonstrate the examples of lookup functions below:

An example table with three different registrations.

### 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*

**Want to learn about Date functions?** Click here.