Formula for Grid Edges

Ambg

New Member
Joined
Jul 3, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi everybody

Hoping you can help where my brain has failed!

I’m looking for a formula I can use that lets me count the number of edges in a grid of variable size.

So ideally, I’d like to have two inputs (example in A1 and A2 where I could put a 2 in A1 and a 2 in the A2 for a 2x2 grid) and the output would then give me the number of edges of a grid in this formation. In this case, 12.

But then I could input in a 3 and a 4, and the output would amend to this new size, and give me an edge count of 31.

All help appreciated! Not even sure if this is doable, but hopefully it is!
Thanks in advance!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Welcome to the Forum!

If your grid dimensions are m x n, then you'll have 2mn + m + n edges.

AB
13
24
331edges
Sheet1
Cell Formulas
RangeFormula
A3A3=2*A1*A2+A1+A2
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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