# Inference

The PromptLoop inference function takes a set of examples and generates the correct text output with AI models in Google Sheets.

## Formula Syntax

The parameters, (inputs, outputs, target cell etc.) work just like any other spreadsheet formula. You can think of PromptLoop like a LOOKUP formula - but instead of matching rows it infers the relationship in your input/output table and returns the result.

This simple formula takes a set or column of **Inputs** and a set or column of **Outputs** and returns the output for an new input or **Target**.

=PROMPTLOOP.INFERENCE( **inputRange**, **outputRange**, **target**)

**InputArray**is the set of**3-10 rows**of inputs for the example data. The inputs must match the outputs in length and should be fixed for each task. This tells the model what you are looking for. Examples should be representative.**OutputArray**is the set of**3-10 rows**matching outputs for the example data. The outputs must match the inputs in length and should be fixed for each task. This tells the model what you outputs you are looking for.**Target**is the input for the model to perform its calculation on. This is always a single cell but you can copy or drag a formula with set input/output Arrays across hundreds of targets to leverage the same function and output task.

## How it works

The Inference function learns what the correct output is based on the examples you provide. This allows for a huge range of text transformation, translation, and comprehension like writing or summaries.

The function uses language models and is therefore geared at text, instead of numbers and quantitative actions where normal spreadsheet formulas do well SUM, AVERAGE, etc.

## Tips and tricks

Select example rows + Select target cell. The examples give the model instructions so the better the examples the more accurate the model outputs will be.

The target is the cell text you want to send to the model.

Set absolute reference like:

```
$A$10:$A$11,$B$10:$B$11
```

You can use the key F4 to do this quickly.

To start using the formula. Set up the formula with the link below or see the guide **here**.

## Error Messages:

This error message indicates that the inputs and/or output examples are not correctly formatted. For Promptloop to work - you must provide pairs of inputs and outputs, usually on the same row, as examples. You can include multiple columns combined as one input or output row, but they may not contain undefined values, blank cells, or #ERRORS!.

This message occurs when the Google Account being used is not linked to an active Promptloop account. It also may indicate that payment method is needed, even if free credits still remain on the account. We recommend adjusting your inputs to rerun the model if you recently upgraded your subscription, as it will take a couple seconds for your account to be activated.

This error message indicates that PromptLoop is not Activated in this sheet - Navigate to the Add-on menu and activate or Re-activate to proceed. You may have to reload the sheet and delete / re-enter the formula if this persists.

This error message indicates that the model timed out before it could find your request. We recommend waiting a few seconds and trying again.

This error message indicates that there is a processing error with one of the AI models used in this function. We suggest checking your syntax, reloading the cells, or if the problem persists you can reach out to help@promptloop.com for further support.

## Need Help?

Reach out to help@promptloop.com and we will be happy to guide you through detailed set up and get started with a few examples so you can start using prompt loop for your specific needs. Or just say hello!