Avatar of Ian Bell
Ian Bell
Flag for United Kingdom of Great Britain and Northern Ireland asked on

modify array formula for one without curly brackets

Hi,
I have had endless problems with Excel crashing or taking an age to calculate. I have just discovered that
it is due to curly bracketed array formulas. My worksheets often contain in excess of 140,000 rows.
Could someone please help me substitute the below formula to one without brackets even if a helper column is required.

{=STDEV.S(IF($A$2:$A$22=A2,$B$2:$B$22))}

Many thanks
Ian
SpreadsheetsMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Ian Bell

8/22/2022 - Mon
Wayne Taylor (webtubbs)

Try the DSTDEV function, which allows you to set multiple criteria...

=DSTDEV(A1:B22,2,D1:D2)

This assumes the column headers are in row 1. Cells D1:D2 contain the criteria, with D1 listing the Column header in cell A1 and cell D2 having the criteria.

A good tutorial for the function is available here.

BTW, the move away from array formulas may or may not help with the calculation time. The biggest issue you will face is the 140,000 rows of data.
Ian Bell

ASKER
Thanks Wayne, I'll check this out after a sleep.
I was wondering if the AGGREGATE function would work and how to modify that formula I posted.
Wayne Taylor (webtubbs)

The DSTDEV function was created specifically for instances where conditions are required, as is the case here. Anything else will be sub-optimal.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Rory Archibald

You could certainly use a helper column with a simple formula that returns the cell value if column A matches the criterion and "" otherwise, since STDEV.S will ignore non-numeric values in the range.
Ian Bell

ASKER
I've enclosed an attachment if you could kindly insert the formula you recommend.
Many Thanks

Please place formula in column that displays yellow background
Wayne Taylor (webtubbs)

Ian, no file is attached, but the formula Rory is suggesting is...

=IF(A2=A$2, B2, "")

...and copy down as required. You can then use a non-array formula on that column to calculate the standard deviation...

=STDEV.S(K:K)

...assuming column K is where you placed the above formula.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Ian Bell

ASKER
Wayne Taylor (webtubbs)

Ahh, I understand now. As you are calculating the StDev for every row, it looks like you'll need to use the array formula you originally used. A helper column won't help.

Why are you calculating the StDev for every row? Can it not be calculated in a summary Pivot Table as in the attached?
Replace-Array-Formula.xlsx
Ian Bell

ASKER
I haven't worked with pivot tables and not wanting to go down that route. The Array is not an option. I was hoping helper columns would be a solution but you say not.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Wayne Taylor (webtubbs)

OK, I guess we can calculate the StDev manually. You'll need 2 helper columns though, using these formula...

=POWER(E5-AVERAGEIF(D:D,D5,E:E), 2)
=SQRT(SUMIF(D:D,D5,G:G)/(COUNTIF(D:D,D5)-1))

See attached.
Replace-Array-Formula--1-.xlsx
Ian Bell

ASKER
Ok thanks Wayne, I'll have to look at it tomorrow, need sleep
Ian
Ian Bell

ASKER
Here is what I am trying to achieve (refer to link below)
The only difference is I am trying to copy down 100k+ rows that contain indexed ID's.
In attached sheet I would like to normalise values in column B within their index ranges.
There are a series of steps outlined in the article and I have done the AVERAGE column (C)
I've colour coded index ranges for clarity sake.
Thank you for your continued patience.
Ian

https://smallbusiness.chron.com/normalize-excel-36009.html
NormaliseValues.xlsx
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Wayne Taylor (webtubbs)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Ian Bell

ASKER
Thanks Wayne the formulas are a perfect solution. Thanks also Rory for your comments.
Ian