---
url: /set-instructions/apply-style-using-formula.md
description: Adds a cell style to elements in the working set based on a formula
---

# Apply Style Using Formula

**Workview-only.** Applies a named cell style to each element in the working list, computed per element by a formula. The formula returns the name of a style defined at the model level, or an empty string for default styling - so different elements can receive different styles based on their own context. See [Styles](/card-guides/styles) for how those named styles are built and managed - the same model-wide style library Cards use via a component's Custom Style property.

| Argument | Type | Description |
| --- | --- | ------ |
| Formula | Formula | The formula to evaluate for each element in the working set |

#### Example

```
IF(HASSTATICVALUE(), "manual-input", "data-input")
```

Applies the `manual-input` style to cells that hold a user-entered value and `data-input` to cells that don't - making it visually obvious which cells have been manually overridden versus calculated. This same pattern is the basis for heatmap-style conditional formatting: swap the condition for one based on a measure's value instead of `HASSTATICVALUE()`.

This only styles elements already in the working list - it doesn't add them. To add an element conditionally in the first place, see [Insert Using Formula](/set-instructions/insert-using-formula).
