i want to understand the difference Between Range And Array

MyExcel

Well-known Member
Joined
Sep 25, 2008
Messages
508
Hi all
i want to understand the difference between array and range
i feel this is misleading
thanks in advanced
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
To my mind, they are similar. They are both a series of values or potential values.

But a Range is series physically located in cells somewhere, and an array is completely in computer memory....an array needs to be "written out" somewhere when you're done or you may lose it, which may be fine depending on what you used the array for.
 
Upvote 0
It's due to how the functions are registered.

SUMPRODUCT() expects arrays. If you pass a reference to a range into SUMPRODUCT, it is clever enough to extract the values of that range (an array of values).

So, example:
Excel Workbook
ABCD
115
226
337
44870
Sheet1
Excel 2002
Cell Formulas
RangeFormula
D4=SUMPRODUCT(A1:A4,B1:B4)



We have passed references to ranges (A1:A4 and B1:B4) into SUMPRODUCT. But really the ranges are dereferenced into arrays {1;2;3;4}, like so:

=SUMPRODUCT(A1:A4,B1:B4)

becomes --->

=SUMPRODUCT({1;2;3;4}, {5;6;7;8})


A1:A4 and B1:B4 are ranges.
{1;2;3;4} and {5;6;7;8} are arrays.

Does that help?
 
Upvote 0
Excel Workbook
ABCD
1DateCustomersRegionAmount
201/01/2008ABCEast12584
331/03/2008CDEEast16651
429/06/2008ACCWest24199
527/09/2008DADEast23692
626/12/2008AEAWest24320
726/03/2009ANAEast18305
824/06/2009ACCEast19356
930/06/2009ACCWest25197
1001/07/2009ACCEast16336
1106/07/2009ABCEast12597
12
1335692
1435692
Thanx colin L Sheet1

Excel 2007
Cell Formulas
RangeFormula
A13=SUMPRODUCT(--(YEAR($A$2:$A$11)=2009),--($B$2:$B$11="ACC"),--(C2:C11="East"),D2:D11)
A14=SUMIFS($D$2:$D$11,$A$2:$A$11,">=2009-01-01",$A$2:$A$11,"<2010-01-01",$B$2:$B$11,"ACC",$C$2:$C$11,"East")


bt i this example
Sumproduct Accept to use formula to convert date and then sum it because it is array case
but SumIfs Doesn't becuse it is Range
what i understand from it
when i am useing formula like Sumproduce i can use another formula into it to do onther job
while
we can't do it in SumIFs
:confused:
 
Upvote 0

See Colin's description. We would to add that (A) some functions like Offset, SumIf, CountIf, SumIfs, and CountIfs are designed to operate only on (multi-cell) range objects, while (B) Sum, SumProduct, Frequency, Linest, lookup functions, etc. take both range and array objects.

Consider A2:A5...

<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64 x:str><COLGROUP><COL style="WIDTH: 48pt" width=64><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 12.75pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17 width=64 align=right x:num>3</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17 align=right x:num>2</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17 align=right x:num>4</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17 align=right x:num>5</TD></TR></TBODY></TABLE>

which is a range object.

Try:

1. SUMIF(A2:A5,">3")

2. SUMIF({3;2;4;5},">3")

The formula in (2) won't succeed, which figures an array object (i.e., {3;2;4;5}) as reference.

3. FREQUENCY(A2:A5,2)

4. FREQUENCY({3;2;4;5},2)

Both (3) and (4) would happily yield the same result.

BTW:

YEAR($A$2:$A$11)

yields an array object that SumProduct can process, while SumIf(s) by design as stipulated above cannot.
 
Last edited:
Upvote 0
See Colin's description. We would to add that (A) some functions like Offset, SumIf, CountIf, SumIfs, and CountIfs are designed to operate only on (multi-cell) range objects, while (B) Sum, SumProduct, Frequency, Linest, lookup functions, etc. take both range and array objects.
thanx Aladin
i read Colin's Desription, and it is great Tips and 1000 thanx for him
but
when i am useing formula like Sumproduce i can use another formula into it to do onther job
while
we can't do it in SumIFs
this is a case which puzzled me ?
 
Upvote 0

Forum statistics

Threads
1,216,146
Messages
6,129,142
Members
449,488
Latest member
qh017

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top