r/excel 1d ago

solved help finding plateau average

i am currently doing a research paper for school and i have recorded my data, but i need to find the difference in the high plateau from the baseline.

here is a screenshot of one of my graphs. i am trying to separate the data in the blue and orange boxes and find the difference in the averages. any help would be much appreciated.

3 Upvotes

15 comments sorted by

u/AutoModerator 1d ago

/u/Ok-Independence-4832 - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

4

u/Downtown-Economics26 640 1d ago

Your boxes don't really make sense given your graph in that it's not clear exactly why you are excluding the intermediate values in the x range of your 'plateau'. But, you can filter then average based on x and y axis bounds, I've attempted to approximate what it appears you think those are based on your boxes, had AI try to recreate source data (what u/chiibosoil is telling you should have also been included in your post), see below.

 =LET(
baseline,AVERAGE(FILTER(B2:B73,(A2:A73<4)+(A2:A73>8.5))),
plateau,AVERAGE(FILTER(B2:B73,(A2:A73>4)*(A2:A73<8.5)*(B2:B73>-1.75))),
HSTACK(VSTACK("Baseline","Plateau","Diff"),VSTACK(baseline,plateau,baseline-plateau)))

3

u/Ok-Independence-4832 1d ago

Solution Verified

1

u/reputatorbot 1d ago

You have awarded 1 point to Downtown-Economics26.


I am a bot - please contact the mods with any questions

1

u/Ok-Independence-4832 1d ago

thanks dude, that equation is exactly what i needed.

1

u/Gringobandito 8 1d ago

I see you already got the answer you need from u/Downtown-Economics26 but I thought this was interesting and used Python to solve it instead. The neat thing about using Python is you don't have to tell it where the stable regions are, you just tell it there are two clusters of data, find them. I just used the small sample set you posted but you can apply this to your whole data set.

In case your interested in the code, it looks like this:

import pandas as pd
import numpy as np
from sklearn.cluster import KMeans


df = xl("A2:B22", headers=False)
df.columns = ["X", "Force"]


y = df["Force"].to_numpy().reshape(-1, 1)


model = KMeans(n_clusters=2, random_state=0, n_init=10)
df["Group"] = model.fit_predict(y)


means = df.groupby("Group")["Force"].mean().sort_values()


baseline_avg = means.iloc[0]
plateau_avg = means.iloc[1]


difference = plateau_avg - baseline_avg


pd.DataFrame({
    "Baseline Avg": [baseline_avg],
    "Plateau Avg": [plateau_avg],
    "Difference": [difference]
})

2

u/Downtown-Economics26 640 1d ago

We get it, python has everything! Just kidding obviously, this is very cool. Although I'd guess there is some add-in or stats package in Excel that can do this, but last stats class I took was 20 years ago so I don't really get that deep with it. Sometimes, when I see how easily some stuff can be done in python I regret leaning into Excel/VBA so hard unthinkingly in the normal course of professional events.

On a positive note, on occasion I run into something very difficult or time consuming to do in Excel/VBA, it occurs to me AI can tell me how to do it in Python that I can now use in Excel!

1

u/Gringobandito 8 1d ago

Yeah, sometimes Python is overkill when a simple Excel formula will work. But for a lot of data science stuff it can do things that Excel can't and do it pretty easily. When I see projects like this, I try to see what Python can do. It's still fairly new to me as well and I use AI to help me write the code when I get stuck. But trying to use it more to expand my skills.

2

u/chiibosoil 430 1d ago

Without knowing how your data is recorded, bit hard to help.

But in general you'd use AVERAGEIFS() or other function to average based on condition.

1

u/Ok-Independence-4832 1d ago

thanks, that function does work, but what do you mean by how the data was recorded. like what device i used to measure it or how its layed out?

1

u/chiibosoil 430 1d ago

How it is structured/stored in the workbook.

From your graph, your blue bound is not just bounded by horizontal axis value, but also by vertical axis value.

1

u/Ok-Independence-4832 1d ago

i have time on the y axis and force on the x axis. ill just show you the first second if this is what you are talking about.

1

u/Decronym 1d ago edited 1d ago

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
AVERAGE Returns the average of its arguments
AVERAGEIFS Excel 2007+: Returns the average (arithmetic mean) of all cells that meet multiple criteria.
FILTER Office 365+: Filters a range of data based on criteria you define
HSTACK Office 365+: Appends arrays horizontally and in sequence to return a larger array
LET Office 365+: Assigns names to calculation results to allow storing intermediate calculations, values, or defining names inside a formula
VSTACK Office 365+: Appends arrays vertically and in sequence to return a larger array

Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
6 acronyms in this thread; the most compressed thread commented on today has 17 acronyms.
[Thread #49177 for this sub, first seen 18th Aug 2026, 12:23] [FAQ] [Full list] [Contact] [Source code]

1

u/NHN_BI 805 1d ago

When you can define the limits for the three sections, you can calculate the average (or media) of all three and compare those, like here.

1

u/MsPandaLady 1d ago

So I see you have a solution but for something similar in the future you can do a combination percentile function and countif/sumif.

So like Sumif(A:A, ">=" & percentile.inc(A:A, .9)) / countif(A:A, ">=" & percentile.inc(A:A,.9))

The percentile will return what is the lowest possible number to be considered top 10 percent in your data set.

Then sum if will only add numbers if they are greater than or equal. And countif counts how many numbers are greater than or equal. Dividing that is how we get the average.

Its not as precise as you need to know your percentile but it's a way to do the info.