Help in Trying to Understand Formulas of form “CSE Curly Bracket” that you have to input as an Array.

DocAElstein

Banned user
Joined
May 24, 2014
Messages
1,336
Hi,<o:p></o:p>
. Like I guess many people I struggle a bit to understand these Formulas of form“CSE Curly Bracket” that you have to input as an Array. (I sort of gave up for a while trying to fully understand , and rather concentrated on at least getting to understand or “accept” “The rules” of using them form amongst others MrExcel Threads such as Post # 22 here to name but 1:<o:p></o:p>
http://www.mrexcel.com/forum/excel-...ltiple-values-matching-unique-criteria-3.html )<o:p></o:p>
…I then even surprised myself and managed to answer a last couple of threads with a quite complicated CSE Formula!!.<o:p></o:p>
.But I still do not quite get it and am desperate to get at least a bit more clarity in my head on these things ….<o:p></o:p>
. Along the way in getting the formulas I used in answering those last two Threads I noticed something ”odd”. Without understanding it I used what seemed to be happening there to develop the formulas I used.<o:p></o:p>
. Maybe if someone “in the know” could explain in as much detail as you may be able to what is going on in the next small example it could help go some way in clearing the mystery of these things up a bit. (It may be a bit clearer to follow the file I upload at the end rather than the screen shots )<o:p></o:p>
<o:p> </o:p>
…So a simple example: <o:p></o:p>
<o:p> </o:p>
In some arbritrary place in a spread sheet I type in the following<o:p></o:p>
<o:p> </o:p>

Book1
GH
2615
2722
2837
2948
ForMrExcelFred



……<o:p></o:p>

<o:p> </o:p>
If I do the following anywhere in the spreadsheet as long as all rows are the same then I get the same results with CSE and non CSE formulas.. <o:p></o:p>
<o:p> </o:p>
(. Note For CSE1 -- I highlight all 4cells. -– Hit F2. –- Enter Formula. –- Confirm with CSE<o:p></o:p>
………For CSE 2 -- I highlight just the first cell. -– Hit F2. –-Enter Formula. –- Confirm with CSE. --- Drag that first formula down to occupy all 4 cells<o:p></o:p>
. I am also not too clear on the difference here. Until now I have obtained similar results for both CSE variations. )<o:p></o:p>
<o:p> </o:p>

Book1
IJKL
25CSE1CSE2NOT CSENOT CSE2
26FalseFalseFalseFalse
27TrueTrueTrueTrue
28FalseFalseFalseFalse
29FalseFalseFalseFalse
ForMrExcelFred
Cell Formulas
RangeFormula
K26=IF(G26:G29=H26:H29,"True","False")
K27=IF(G27:G30=H27:H30,"True","False")
K28=IF(G28:G31=H28:H31,"True","False")
K29=IF(G29:G32=H29:H32,"True","False")
L26=IF(G26:G29=H26:H29,"True","False")
L27=IF(G26:G29=H26:H29,"True","False")
L28=IF(G26:G29=H26:H29,"True","False")
L29=IF(G26:G29=H26:H29,"True","False")
I26:I29{=IF(G26:G29=H26:H29,"True","False")}
J26{=IF(G26:G29=H26:H29,"True","False")}
J27{=IF(G27:G30=H27:H30,"True","False")}
J28{=IF(G28:G31=H28:H31,"True","False")}
J29{=IF(G29:G32=H29:H32,"True","False")}
Press CTRL+SHIFT+ENTER to enter array formulas.




…….<o:p></o:p>
<o:p> </o:p>
. If however I do something similar in the spreadsheet with any amount of offset in the rows such as here, then only the CSE’s work<o:p></o:p>
<o:p> </o:p>

Book1
IJKL
18CSE1CSE2NOT CSE1NOT CSE2
19FalseFalse#WERT!#WERT!
20TrueTrue#WERT!#WERT!
21FalseFalse#WERT!#WERT!
22FalseFalse#WERT!#WERT!
ForMrExcelFred
Cell Formulas
RangeFormula
K19=IF(G26:G29=H26:H29,"True","False")
K20=IF(G27:G30=H27:H30,"True","False")
K21=IF(G28:G31=H28:H31,"True","False")
K22=IF(G29:G32=H29:H32,"True","False")
L19=IF(G26:G29=H26:H29,"True","False")
L20=IF(G26:G29=H26:H29,"True","False")
L21=IF(G26:G29=H26:H29,"True","False")
L22=IF(G26:G29=H26:H29,"True","False")
I19:I22{=IF(G26:G29=H26:H29,"True","False")}
J19{=IF(G26:G29=H26:H29,"True","False")}
J20{=IF(G27:G30=H27:H30,"True","False")}
J21{=IF(G28:G31=H28:H31,"True","False")}
J22{=IF(G29:G32=H29:H32,"True","False")}
Press CTRL+SHIFT+ENTER to enter array formulas.

<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
. I kind of saw enough logic in what was going on in order to be able to know when I needed to use the “CSE trick” to get my formulas to do what I wanted. But I do not quite understand how and why. And that is very frustrating. Googling has not helped, and I am finding some people here have a more in depth knowledge than any book.<o:p></o:p>
<o:p> </o:p>
. Can anyone here help me..<o:p></o:p>
<o:p> </o:p>
. Thanks<o:p></o:p>
. BTW. No rush on this one. Rather a good in depth answer when someone has the time.<o:p></o:p>
. Very much appreciated<o:p></o:p>
Alan<o:p></o:p>
<o:p> </o:p>
.P.s. 1. In case it helps and may be easier to follow, the File I gave/ used in developing one of those tricky CSE formulas I did which also has this example above in is here.<o:p></o:p>
https://app.box.com/s/r6ptaai08xobj5qx6irbvxhzfuunyjvn<o:p></o:p>
(XL2007: “VerticalToHorizontal.xlsx” Sheet of interest: Sheet6 name: “ForMrExcelFred” )<o:p></o:p>
<o:p> </o:p>
.P.s.2 I am an avid user nowadays of F9 to do an instant evaluation of parts of the formulas since this was explained to me. Usually it is a great help. But it is failing me here as it is suggesting (possibly naively on my behalf ) that my NOT CSE2 possibly should always work anywhere ), and also suggests to me that my CSE2 should not always work anywhere ( or at least in the second example should give me {False,False,True,True} !?!? )<o:p></o:p>
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
CSE2, because it is array entered into one cell only, will return the first value from the array.

For the non CSE versions, Excel will try to use the intersection of the formula cell and the entire rows/columns of the referenced range if it can - but only if the intersection is a single cell. So if you refer to a range in one column, but put the formula below that range, it will fail; alongside it will work. Equally, if you refer to a range that has multiple rows and columns, the formula won't work anywhere unless you array enter it.
 
Upvote 0
CSE2, because it is array entered into one cell only, will return the first value from the array……..



. O.K. I was probably a bit careless / confused with my “F9 Evaluate in Formula Bar” investigations there and confusing CSE1 With CSE2. The results do tie up when I look again. Even so I would have had to “assume” that Excel was returning the first value. – That may have been then an “obvious” conclusion. -. But I did not manage to “Google” that one. So very helpful that you confirmed that. Thanks.

………………………………………___________________


………..
For the non CSE versions, Excel will try to use the intersection of the formula cell and the entire rows/columns of the referenced range if it can - but only if the intersection is a single cell. So if you refer to a range in one column, but put the formula below that range, it will fail; alongside it will work. ……..



. O.K. I think I am following that as well . - It is a case again of knowing wot Excel is doing. I don’t, you do (it may be written somewhere but I could not find it. If I get the point here, for each individual cell reference that is made, Excel sort of goes searching (in this case left and right as it is a range in one column) , and if it gets lucky and hits the correct Range it is looking for then all well and good. It is perhaps unfortunate that my NOT CSE1 column and NOT CSE2 column are giving the same results. They should indeed give the same results but the Ranges being referenced are different. There are 4 different ones in the Example NOT CSE2 and in NOT CSE1 the same ranges are referenced 4 times. (But your explanation is still valid.)
. If I may just attempt to explain that graphically, with the strength of the color indicating how often ranges are referenced:

NOT CSE 1:




Book1
GHI
30NOT CSE1
3115False
3222True
3337False
3448False
ForMrExcelFred
Cell Formulas
RangeFormula
I31=IF(G31:G34=H31:H34,"True","False")
I32=IF(G31:G34=H31:H34,"True","False")
I33=IF(G31:G34=H31:H34,"True","False")
I34=IF(G31:G34=H31:H34,"True","False")




………………………________________________


NOT CSE 2:



Book1
GHI
36NOT CSE2
3715False
3822True
3937False
4048False
41
42
43
ForMrExcelFred
Cell Formulas
RangeFormula
I37=IF(G37:G40=H37:H40,"True","False")
I38=IF(G38:G41=H38:H41,"True","False")
I39=IF(G39:G42=H39:H42,"True","False")
I40=IF(G40:G43=H40:H43,"True","False")




. Another answer to the above bit (which follows on nicely to the last bit below) is that there exists a sort of “implicit default” bit here on where Excel “goes – a – looking” when it sees a multiple rows or columns. This Implicit default in this case is according to the rules / explanation you gave.



So Finally:-

……. Equally, if you refer to a range that has multiple rows and columns, the formula won't work anywhere unless you array enter it.




. The CSE is not such a mystery at all (when someone in the know shares the “secret! – Thanks!). (And as I think I either read or dreamt I read , “ Excel does not really have Array formulas…” )..

. The CSE Curly bracket is not much more than explicitly telling Excel where to go.
.
. Correspondingly, and along a similar argument (sort of), something I did not dream
.
VBA doesn't really have array functions……...
( http://www.mrexcel.com/forum/excel-...ic-applications-evaluate-range-vlookup-4.html )

. So a final thought… In a spreadsheet this
{Here Stuff}

is similar to in VBA this
Array(This stuff),

with Here Stuff being got at by evaluating wot it is , or in the following case just taking wot it is (which I suppose is a form of evaluating as well):

…Spreadsheet: { “B” , “A” }

Is a similar idea to:

.. VBA : Array ( “B” , “A” )

. ….

Many thanks.

Alan

P.s. File again for anyone wanting to follow the “graphical explanation” a bit easier..
https://app.box.com/s/76jm70vxiirk93zaubhet4fsw10u3sv3
 
Upvote 0

Forum statistics

Threads
1,224,856
Messages
6,181,427
Members
453,040
Latest member
Santero

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