Excel Formula for Calculating Average Peak-Hour Energy Consumption

📅 May 24, 2026 📝 Sarah Miller

Managing volatile utility costs is challenging, especially when trying to isolate peak demand periods from standard billing data. While monthly utility bills provide a basic overview, utilizing targeted Excel formulas grants energy managers the precise, granular insights needed to identify peak-shaving opportunities. This analysis stipulates that your interval data is consistently formatted with clear timestamps. For example, using the formula =AVERAGEIFS(Consumption_Range, Time_Range, ">=13:00", Time_Range, "<=17:00") effectively isolates a 1 PM to 5 PM peak window. Below, we will step-by-step explore how to configure this formula to optimize your load profiling.

Excel Formula for Calculating Average Peak-Hour Energy Consumption

Introduction to Peak Energy Analysis in Excel

Managing and analyzing energy consumption is a critical task for facilities managers, sustainability officers, and homeowners looking to optimize utility costs. Many electric utilities charge premium rates-known as Time-of-Use (TOU) or peak tariffs-during periods of high demand. Typically, these peak hours occur during late afternoon and early evening, when grid strain is at its highest.

To identify cost-saving opportunities or evaluate the impact of energy efficiency measures, you need to isolate and analyze your energy usage during these specific periods. Microsoft Excel is an exceptional tool for this task. By leveraging formulas such as AVERAGEIFS, FILTER, and time-stripping mathematical operations, you can easily calculate your average energy consumption during peak hours. This comprehensive guide will walk you through setting up your data, building the formulas, and troubleshooting common time-formatting issues in Excel.

---

Understanding the Data Structure

Before writing formulas, your raw data must be structured correctly. Typically, smart meters and energy monitoring systems export data in intervals (e.g., 15-minute, 30-minute, or hourly intervals) consisting of timestamps and consumption metrics (measured in kilowatts, kW, or kilowatt-hours, kWh).

Let's assume a standard dataset with the following structure:

  • Column A (Date/Time): The timestamp of the reading (e.g., 2023-10-24 14:00).
  • Column B (Energy Consumption): The recorded consumption in kWh.

For our examples, we will define Peak Hours as 13:00 (1:00 PM) to 19:00 (7:00 PM).

---

Method 1: The Core AVERAGEIFS Formula (Best for Separate Time Columns)

If your dataset already separates the Date and Time into distinct columns, or if you are working with a single day's cycle where only time matters, the AVERAGEIFS function is the most straightforward tool to use.

The syntax for AVERAGEIFS is:

=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Step-by-Step Implementation

Assume your time values are in Column B (formatted as Time) and your consumption values (kWh) are in Column C.

  1. Select the cell where you want to display the average peak consumption (e.g., cell E2).
  2. Enter the following formula:
    =AVERAGEIFS(C2:C100, B2:B100, ">=13:00", B2:B100, "<=19:00")
  3. Press Enter. Excel will calculate the average of all energy values in range C2:C100 where the corresponding time in B2:B100 falls between 1:00 PM and 7:00 PM, inclusive.

Using Dynamic Cell References

Hardcoding times into formulas is generally not recommended because peak windows can change seasonally. Instead, reference specific cells containing your peak start and end times:

  • Cell F1: Start Time (e.g., 13:00)
  • Cell F2: End Time (e.g., 19:00)

Use this dynamic formula:

=AVERAGEIFS(C2:C100, B2:B100, ">="&F1, B2:B100, "<="&F2)
---

Method 2: Handling Combined Date and Time Stamps

Most industrial meters export date and time merged into a single cell (e.g., 10/24/2023 14:30). Because Excel stores dates as whole numbers and times as decimal fractions (e.g., 12:00 PM is represented as 0.5), a direct AVERAGEIFS comparison against simple time values like 13:00 will fail.

To solve this, we can extract the time component using the MOD function or utilize helper columns.

Approach A: The Helper Column Method (Highly Recommended for Performance)

Adding a helper column simplifies complex calculations and keeps your spreadsheet running fast, especially with large datasets spanning months or years.

  1. Insert a new column next to your timestamp column. Name it "Time Only".
  2. Assuming your combined timestamp is in cell A2, enter this formula in your helper column (cell B2):
    =MOD(A2, 1)
    Note: The MOD function with divisor 1 removes the integer portion (the date) and leaves only the decimal remainder (the time).
  3. Format this helper column as Time (HH:MM).
  4. Drag the formula down to fill your dataset.
  5. Now, apply your AVERAGEIFS formula referencing this new column:
    =AVERAGEIFS(C2:C100, B2:B100, ">=13:00", B2:B100, "<=19:00")

Approach B: Array Formula using FILTER (Office 365 & Excel 2021)

If you are using a modern version of Excel and prefer not to use helper columns, you can use the dynamic array function FILTER paired with MOD to perform the calculation on the fly:

=AVERAGE(FILTER(B2:B100, (MOD(A2:A100, 1)>=TIME(13,0,0)) * (MOD(A2:A100, 1)<=TIME(19,0,0))))

How this works:

  • MOD(A2:A100, 1) extracts the time components from the entire timestamp range.
  • The multiplication operator (*) acts as an AND condition, ensuring that only rows meeting both conditions (after or at 13:00 AND before or at 19:00) are returned.
  • FILTER isolates those consumption values, and AVERAGE computes their mean.
---

Method 3: Excluding Weekends (Weekday-Only Peak Rates)

Many commercial energy tariffs only apply peak-hour rates on weekdays (Monday through Friday). To accurately calculate your average peak consumption, you must filter out weekend entries.

You can achieve this easily by incorporating the WEEKDAY function into your worksheet.

Using a Weekday Helper Column

  1. Create a helper column named "Is Weekday".
  2. In cell C2 (assuming your timestamp is in A2), enter:
    =WEEKDAY(A2, 2)
    Note: Setting the return type to "2" maps Monday to 1 and Sunday to 7. Therefore, any value less than or equal to 5 is a weekday.
  3. Modify your AVERAGEIFS formula to check this weekday status:
    =AVERAGEIFS(Consumption_Range, Time_Range, ">=13:00", Time_Range, "<=19:00", Weekday_Range, "<=5")

This ensures your resulting average is an accurate reflection of weekday operational costs, preventing weekends from artificially lowering your peak analysis average.

---

Troubleshooting Common Excel Errors

When working with energy data exports, you are likely to run into data type mismatches. Here are the most common issues and how to fix them:

1. Times are Stored as Text

If your AVERAGEIFS formula returns a #DIV/0! error, Excel likely isn't recognizing your times as numeric values. To test this, use the formula =ISNUMBER(A2). If it returns FALSE, your dates/times are text.

  • The Fix: Select your date column, go to the Data tab, select Text to Columns, and immediately click Finish. This forces Excel to re-evaluate and convert text dates into numeric timestamps.

2. Handling Non-Standard Interval Alignments

If your smart meter records data precisely on peak transitions (e.g., 13:00:00), decide whether to include or exclude that boundary. Adjust your comparison operators accordingly: use ">" (greater than) instead of ">=" (greater than or equal to) if you need strict boundary isolation.

---

Conclusion

By mastering these Excel formulas, you can quickly analyze utility interval data to pin down average consumption metrics during expensive peak demand periods. Whether using a simple AVERAGEIFS, an advanced FILTER array, or helper columns with the MOD and WEEKDAY functions, isolating high-cost windows allows you to make informed decisions about energy curtailment, battery storage scheduling, or shifting operations to off-peak periods.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.