> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Headcount planning

> Build a headcount plan in Runway using HRIS data, segmented databases, and drivers for employee counts and costs.

Headcount planning helps you model current employees, future hires, department-level headcount, and related payroll costs. Use the new HRIS database approach for new implementations; use the legacy expand-by-dimension approach only for older models already built that way.

<Info>
  **Which approach should I use?**

  * **New HRIS databases:** Use regular databases with segmentation. This is recommended for new implementations.
  * **Legacy HRIS databases:** Use **Expand by dimension** in a model. This remains supported for existing models built with the legacy pattern.
</Info>

## Step 1: Set up your employee database

The first step is getting employee data into Runway. The recommended path is to connect an [HRIS integration](/integrations/hris/rippling).

<Frame>
  <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step1-database.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=75661cfd9121c66462695af10f5f4037" alt="Employee database populated from an HRIS source" width="2458" height="1284" data-path="images/headcount/headcount-step1-database.png" />
</Frame>

If you do not have a supported integration available, use one of these alternatives:

* **Google Sheets:** Export employee data to a sheet and connect it to Runway. Keep the sheet current because Runway reflects the connected sheet data.
* **Manual setup:** Create a standalone database directly in Runway with no external data source.

Once your database exists, populate key fields such as **Start date**, **Termination date**, and dimensions for breakdowns such as **Department**, **Role**, or **Location**.

## Step 2: Create headcount drivers

Choose the approach that matches your HRIS database type.

<Tabs>
  <Tab title="New HRIS databases">
    ### Database with segmentation

    New HRIS databases behave like regular databases in Runway, so you can reference them in formulas and stack them to create drill-ins. When segmenting by dimensions that change over time, such as Department or Job Title, segment from the source query so historical changes are captured.

    <Steps>
      <Step title="Create a rollup database">
        Add a database that points to your Employees query or employee source database.
      </Step>

      <Step title="Segment by the dimension">
        In database configuration, segment by the dimension you want to aggregate to, such as Department. This pulls dimension values from the query so new departments and changes can flow in.
      </Step>

      <Step title="Add Headcount">
        Add a numeric driver column called **Headcount**.
      </Step>

      <Step title="Write the count formula">
        Set the formula to count employees where the employee's Department equals this database row's Department, the Start date is on or before this month, and the Termination date is on or after this month.
      </Step>

      <Step title="Add more metrics">
        Add columns such as monthly salary cost or average salary using the same pattern: reference the Employees database and filter to the current row's segment.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Legacy HRIS databases">
    ### Expand by dimension

    If you are working with a legacy HRIS database, use **Expand by dimension** to create one headcount driver per dimension value.

    <Steps>
      <Step title="Create a headcount driver">
        In a model, select **+ Add Driver** and create a driver called **Headcount**.

        <Frame>
          <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step2-create-driver.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=0e9716e19e478407ae54763b2e224f58" alt="New Headcount driver in a model" width="1032" height="530" data-path="images/headcount/headcount-step2-create-driver.png" />
        </Frame>
      </Step>

      <Step title="Expand by the dimension">
        Right-click the new driver, open **Dimensions**, choose **Expand by dimension**, then select the dimension you want to segment by.

        <Frame>
          <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step2-expand.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=0c97619b2d563b1f9d7e7363251e76ad" alt="Expand Headcount by Department dimension" width="1848" height="1262" data-path="images/headcount/headcount-step2-expand.png" />
        </Frame>
      </Step>

      <Step title="Build the formula">
        Double-click the forecast formula cell for one dimensional driver and use `count()` to count employees.

        <Frame>
          <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step3-count-formula.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=5568eef97ecfcba6d93f835714327ea2" alt="Count formula for a headcount driver" width="1484" height="554" data-path="images/headcount/headcount-step3-count-formula.png" />
        </Frame>
      </Step>

      <Step title="Filter the employee database">
        Filter the Employees database to the matching dimension value, then add date filters for active employment: Start date on or before this month and Termination date on or after this month.

        <Frame>
          <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step3-count-formula-filters.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=16964e16c02bbc04562ec6670c785356" alt="Headcount formula filters for department and employment dates" width="1496" height="694" data-path="images/headcount/headcount-step3-count-formula-filters.png" />
        </Frame>
      </Step>

      <Step title="Copy the formula">
        Copy the formula to the rest of the headcount drivers. Because the drivers and formulas reference the same dimension, the filters match each segment.
      </Step>

      <Step title="Create Total Headcount">
        Create a **Total Headcount** driver and sum the segmented headcount drivers, the driver group, or the database directly.
      </Step>
    </Steps>

    <Info>
      If you have multiple dimensions with the same name, select the one coming from your HRIS data source.
    </Info>

    <Warning>
      **Expand by dimension** does not automatically create drivers when new attributes are added to a dimension. If you frequently add departments or other dimension values, update the model manually.
    </Warning>

    <Frame>
      <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step3-sum.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=38d30f64901a6fa36aadfe4eaeaec254" alt="Total headcount formula summing segmented headcount drivers" width="1398" height="760" data-path="images/headcount/headcount-step3-sum.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step3-sum-group.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=2e0df6df74660b77d11d8d6943ba0b2f" alt="Total headcount formula summing a driver group" width="1386" height="762" data-path="images/headcount/headcount-step3-sum-group.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step3-sum-database.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=70d34270c7ff67310e0816e81bc3c830" alt="Total headcount formula summing the employee database directly" width="1480" height="600" data-path="images/headcount/headcount-step3-sum-database.png" />
    </Frame>
  </Tab>
</Tabs>

## Step 3: Add new employees

The easiest place to add new hires is the Employees database.

<Steps>
  <Step title="Add the employee row">
    Click **+ Add Item** in the Employees database.

    <Frame>
      <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step4-add-employee.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=920b880751ed18a3d0c4cd5f816fce87" alt="New employee row added to the Employees database" width="1296" height="746" data-path="images/headcount/headcount-step4-add-employee.png" />
    </Frame>
  </Step>

  <Step title="Fill required fields">
    Fill in the dimensions and dates used in your formulas, typically Department, Start date, and Termination date if relevant.
  </Step>

  <Step title="Verify the rollup">
    For new HRIS databases, check the rollup database for the correct department segment. For legacy HRIS databases, open the model, click the caret next to the headcount driver, and confirm the employee appears in the breakdown.

    <Frame>
      <img src="https://mintcdn.com/runway-5055a12e/zqp1VpJvDoOQkhBf/images/headcount/headcount-step4-drill-in.png?fit=max&auto=format&n=zqp1VpJvDoOQkhBf&q=85&s=0a64bf4ef91fec59c4fe0d45bb4628d6" alt="Headcount driver drill-in showing employee inputs" width="1104" height="988" data-path="images/headcount/headcount-step4-drill-in.png" />
    </Frame>
  </Step>
</Steps>

## What's next

* [Prorated salaries](/guides/modeling/prorated-salaries)
* [FX rate](/guides/modeling/fx-rate)
* [Commissions](/guides/modeling/commissions)
