1 Attachment(s)

Formula to calculate indexes from row and column

This is as much about programming as it is software, but I thought there might be a nifty way to do it with excel that I'm unaware of.

I have two sets of numbers, indexes for rows and columns, and I need to map them to indexes. Rather than actually setting the cell values, I'm trying to get them 'on-the-fly', but I can't get the formula to work.

Eg:

Code:

`Row Col Index`

0 0 0

0 1 1

0 2 2

0 3 3

0 4 4

1 0 5

1 1 6

1 2 7

1 3 8

1 4 9

2 0 10

2 1 11

2 2 12

2 3 13

2 4 14

3 0 15

3 1 16

3 2 17

3 3 18

3 4 19

I need a formula which will always return the index when it's given the row and column, but I can't find one that works.

Here's a spreadsheet if you fancy playing around with it.