Matrix Excel formula

JaiJana

New Member
Joined
Jan 11, 2016
Messages
4
Hey, I am trying something with excel.. This is my desired result (of course entered manually for each cell)
array.png


I want to replicate this entirely with formulas .. In cell A1
Code:
=+IF(COLUMNS($A:A)>ROWS($1:1),COLUMNS($A:A)-1,IF(COLUMNS($A:A)=ROWS($1:1),0,ROWS($1:1)-1))

The formula I tried did not give me the result as you can see with the highlighted in orange cells has different numbers
wrong_array.png

Is there a single formula and preferrably elegant formula that gives me what I need.?

Thank you one and all.. This is my first post..:)
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Excel 2012
ABCDEF

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="bgcolor: #FFC000, align: right"]2[/TD]
[TD="bgcolor: #FFC000, align: right"]3[/TD]
[TD="bgcolor: #FFC000, align: right"]4[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]2[/TD]
[TD="bgcolor: #FFC000, align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="bgcolor: #FFC000, align: right"]3[/TD]
[TD="bgcolor: #FFC000, align: right"]4[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]3[/TD]
[TD="bgcolor: #FFC000, align: right"]3[/TD]
[TD="bgcolor: #FFC000, align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="bgcolor: #FFC000, align: right"]4[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]4[/TD]
[TD="bgcolor: #FFC000, align: right"]4[/TD]
[TD="bgcolor: #FFC000, align: right"]4[/TD]
[TD="bgcolor: #FFC000, align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]5[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]
[TD="bgcolor: #FFC000, align: right"]5[/TD]
[TD="align: right"]0[/TD]

</tbody>
Sheet4

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]A1[/TH]
[TD="align: left"]=+IF(COLUMNS($A:A)>ROWS($1:1),COLUMNS($A:A)-1,IF(COLUMNS($A:A)=ROWS($1:1),0,ROWS($1:1)-1))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Workbook Defined Names[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Name[/TH]
[TH="align: left"]Refers To[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]A[/TH]
[TD="align: left"]=Sheet3!$A:$A[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,104
Messages
6,170,125
Members
452,303
Latest member
c4cstore

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