Solved

Array formula

Posted on 2013-12-02
9
589 Views
Last Modified: 2013-12-02
All,

A previous question I asked generated a following respons:

Contrary to his statement, ssaqibh's "ARRAY" formula doesn't need to be array-entered to give the correct answer:
=SUM(SUMIFS(Sheet2!$F:$F,Sheet2!$A:$A,{"11020","11030"}))

You could also write it as a SUMIF formula (doesn't need to be array-entered either):
=SUM(SUMIF(Sheet2!$A:$A,{"11020","11030"},Sheet2!$F:$F))

I applied the 1st formual and got my correct response I was shooting for.  I am now curious as to why the expert said this could be entered as an "array" as well, but did not need to, and what an array does for you as opposed to not applying "ctrl,alt,enter", and what is the application to know you need to apply this aspect before you hit the results of the formula.  I guess I'm just wanting a little education on "array formulas".  Are they written different in that they always use the {} symbols in the formula in some way?

Thanks,

Pete
0
Comment
Question by:pedwards3
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 4

Expert Comment

by:andrew_man
ID: 39689998
Some formulas are array formula.  You don't need to press the "ctrl,alt,enter"

Such as sumif, sumifs, sumproduct
0
 

Author Comment

by:pedwards3
ID: 39690009
when do you need to press "ctrl,alt,enter", and why?  What does it do for you, and what is the formula differences when writing?
0
 
LVL 4

Assisted Solution

by:andrew_man
andrew_man earned 100 total points
ID: 39690036
{=SUM(IF(Sheet1!$A:$A={"11020","11030"},Sheet1!$F:$F))}

If you want to use the non-array formula, you need to press "ctrl+alt+enter".  In my point of view, there are a lot of limitation and less flexibility in the array formula, but the array formula is faster than the non-array formula in running.  Therefore, you should select the array formula first (if possible).  

Andrew Man
0
 
LVL 31

Assisted Solution

by:Rob Henson
Rob Henson earned 100 total points
ID: 39690054
Consider this very simple formula:

=SUM(C4:C19)

Simple sum of values in range C4 to C19, however the entries in those cells are numbers with leading apostrophe making them text. Sum of text = 0.

A couple of options for converting the text into numbers so that they will be recognised in the SUM.

One option would be to put a formula in column =C4*1 and then SUM column D. Multiplying a text number by 1 forces Excel to recognise it as a number.

Consider this formula

=SUM(C4:C19*1)

As it stands it would generate an error.

However, confirm with Shift + Ctrl + Enter. In the formula bar it will then look like:

{=SUM(C4:C19*1)}

and it will work. The array setting tells excel to do the *1 to each cell in the array first.

So in summary, using an array formula tells excel to perform functions to individual cells rather than the range and then subsequent function on the result.

Another example, a column of text entries from which you want to find the length of the longest.

=LEN(TextCell) would give length of individual cell. =Max(LENFormulaRange) using range of LEN formulae would give max length:

{=MAX(LEN(TextCellsRange))} would give result in one hit.

Thanks
Rob H
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 100 total points
ID: 39690066
An array formula is almost always slower than a non-array formula.

As a rule, if the array part is an array constant - i.e. literal values between {} - then you do not have to enter the formula with Ctrl+Shift+Enter. If your {"11020","11030"} values were in two cells, you would have had to array-enter the formula.
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 100 total points
ID: 39690082
Contrary to his statement, ssaqibh's "ARRAY" formula doesn't need to be array-entered
That was because ssaqibh attempted it without array-entering but did not get the desired result (for some weird reason). And when ssaqibh tried array-entering it it gave the desired result. That is why ssaqibh gave that statement.

One of the rules is that if a normal formula gives the correct result then the same formula will give correct result if array-entered....I think.
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 39690119
As Rorya states, array formulas are slower.

I used to have a sheet in Excel 2003 in which I had envoked the Conditional Sum Wizard to create a table of Summary values based on multiple criteria, effectively a pivot table but I needed it to update with real time data rather than having to force the refresh each time.

The Conditional Sum Wizard created Array formulae using the =SUM(IF(...)) syntax and used to work but the sheet took AGES to recalculate. In other words the process looked at the IF and if required included the result in the SUM.

In later versions of Excel, I was able to convert it using SUMIFS and it recalc'd so much quicker.
0
 
LVL 23

Accepted Solution

by:
NBVC earned 100 total points
ID: 39690193
And further to Rory's statement about if you entered the values in 2 separate cells, then you would need to "array enter the formula".... well, you can override that too, by changing SUM to SUMPRODUCT..

e.g.

=SUM(SUMIF(Sheet2!$A:$A,F2:F5,Sheet2!$F:$F))  would need to be array-entered

but

=SUMPRODUCT(SUMIF(Sheet2!$A:$A,F2:F5,Sheet2!$F:$F))  would not need to be array entered.

Both giving same result....

SUMPRODUCT is really an array formula, but it's design doesn't require CSE confirmation.
0
 

Author Closing Comment

by:pedwards3
ID: 39690414
Clears things up tremendously gang.

Thanks for the class.  :-)

Pete
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Outlook Free & Paid Tools
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now