Many of Spreadsheet.com's unique data types (including the Attachment data type) can be assigned via formulas. Combining formulas with the Attachment data type allows you to create logic to determine which attachments to assign, possibly referencing other cells. You can even use formulas to change attachments when data changes in other parts of a worksheet.

### How to input formulas in Select and Multiselect cells

Like other cells, you can input a formula into an Attachment data type cell by selecting the attachment cell, clicking on the function bar, and typing in the desired formula.

**Note: **Formulas must use cell references with existing attachments to output an attachment data type. Merely adding the attachment's file name to the formula will not return an attachment. For instance, in the animation below we return the file in the 11th column of a range of cells.

### For Example

For example, in our team's project tracker, we want to attach the right invoice to a project once the project is completed. In the animation below, we go into the invoice column, edit the data type to Attachment, add in our formula which adds in the correct invoice, and apply the formula to the remaining rows in the table.

The formula we paste in looks checks if the project is completed then uses the project's invoice number to match to an invoice in the Budgeting worksheet.

**To see other data types that can use formulas to assign values, check out our advanced formatting articles. Or see our articles on Attachment cells and columns for more on using attachment data types.**