Results 1 to 2 of 2

Math Help - Formula to calculate indexes from row and column

  1. #1
    Echilon
    Guest

    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.
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member TriKri's Avatar
    Joined
    Nov 2006
    Posts
    358
    Thanks
    1
    5*Row + Col, where 5 = number of columns

    To judge from your file, what you have tried to do is:

    index = \left\{\begin{array}{ll}2row+col,&\mbox{ if }<br />
row=0\\2row^2+2+col, & \mbox{ if } row\neq 0\end{array}\right.

    How did you come up with those formulas? :P
    Last edited by TriKri; February 18th 2008 at 06:05 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: August 9th 2011, 03:04 PM
  2. Need a formula to calculate the speed variation.
    Posted in the Math Topics Forum
    Replies: 3
    Last Post: June 1st 2011, 05:25 AM
  3. Help creating a formula to calculate staffing
    Posted in the Business Math Forum
    Replies: 3
    Last Post: June 7th 2010, 07:39 AM
  4. Formula to calculate votes for members
    Posted in the Math Topics Forum
    Replies: 0
    Last Post: November 4th 2009, 11:37 AM
  5. Calculate error using Lagrange formula
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 7th 2008, 10:59 PM

Search Tags


/mathhelpforum @mathhelpforum