Back to Kommo in Excel
SheetXAI logo
Kommo logo
Kommo · Excel Guide

Pull Kommo Event History Into an Excel Workbook to Calculate Time-in-Stage

The Scenario

You are a revenue ops analyst. Your VP of Sales gave you one question: where are deals getting stuck?

You need average days spent in each pipeline stage for 150 deals closed in Q1. The data lives in Kommo's event log, which records every stage change as a timestamped event. To answer the question, you need to pull those events, reconstruct the timeline per deal, calculate duration per stage, and roll it up to an average.

Manually, this is two days of work. The Q1 data is already 45 days old. The VP wants the answer by end of day Thursday.

The bad version of this analysis:

  • You export Kommo events to CSV — the file has 4,000 rows for all event types
  • You filter to stage-change events in the workbook, spending an hour on the right filter
  • You write formulas to calculate days between consecutive events per deal
  • Some events are out of order because of a system glitch in February
  • You spend Wednesday fixing edge cases
  • It is Thursday morning and you have averages for three stages out of seven.

The fast version is two prompts.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Excel workbook that can pull Kommo event logs, reconstruct the timeline, calculate stage durations, and produce the rollup in one run.

Open the SheetXAI sidebar and type:

List all events from Kommo of type 'lead_status_changed' for the past 90 days and write them to an 'Event Log' tab with columns: event_id, event_date, lead_id, from_stage, to_stage, responsible_user.

Once the Event Log is populated, run a second prompt:

Using the 'Event Log' tab, calculate the average number of days each deal spent in each pipeline stage and write results to a 'Stage Duration' tab with columns: stage_name, avg_days, median_days, deal_count — sorted by avg_days descending.

The analysis is ready before your Thursday meeting.

What You Get

A full time-in-stage breakdown built from live Kommo event data:

  • Event Log tab — every stage-change event from the past 90 days, with timestamps and responsible users
  • Stage Duration tab — average days, median days, and deal count per stage
  • Sorted by avg_days descending — the longest average stage is at the top

Median alongside average matters. A few very slow deals can skew the average upward. If your average for Proposal is 21 days but the median is 11, you have outliers worth investigating separately.

What If the Data Is Not Quite Ready

Event log analysis has common messiness that SheetXAI can handle inline.

When events have inconsistent stage name formatting

Kommo sometimes logs stage names with different capitalization depending on when the stage was configured.

After writing the 'Event Log' tab, normalize the from_stage and to_stage columns so all stage names use consistent capitalization and trim any trailing whitespace. Then build the 'Stage Duration' tab from the normalized data.

When you want to filter to Q1 closed deals only

The event pull covers 90 days but you only want deals that closed in Q1.

After writing the 'Event Log', filter it to only include lead_ids where the final to_stage is 'Closed Won' or 'Closed Lost' and the event_date is between January 1 and March 31 of this year. Use that filtered set to build the 'Stage Duration' tab.

When you want to see time-in-stage broken down by responsible user

The VP suspects one rep's deals move faster through Proposal than others.

Using the 'Event Log', calculate average days in each stage per responsible_user and write results to a 'Rep Stage Duration' tab with columns: responsible_user, stage_name, avg_days, deal_count. Sort by responsible_user, then by avg_days descending within each user block.

When you want the full analysis in one prompt

The VP meeting is in four hours and you need everything ready.

Pull all Kommo events of type 'lead_status_changed' for the past 90 days into an 'Event Log' tab with columns: event_id, event_date, lead_id, from_stage, to_stage, responsible_user. Normalize stage names to consistent capitalization. Filter to deals that reached 'Closed Won' or 'Closed Lost' with a final event between January 1 and March 31. Calculate average and median days in each stage and write to 'Stage Duration' sorted by avg_days descending. Calculate average days in each stage per responsible_user and write to 'Rep Stage Duration' sorted by avg_days descending within each user.

The pattern: describe the full chain — pull, clean, filter, aggregate, roll up — in one prompt and let SheetXAI handle the sequence.

Try It

Get the 7-day free trial of SheetXAI and run your next pipeline velocity analysis from an Excel workbook connected to Kommo's event log. The Kommo integration is included in every SheetXAI plan. For related workflows, see how to run a pipeline review and bulk-update deal stages or the Kommo in Excel overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more