×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# calculating the distance between cells in excel (randomize moving cells)

## calculating the distance between cells in excel (randomize moving cells)

(OP)
Suppose I want to compute the distance between a 3by4 cells in a square grid in excel. The distance between two cells is 1m.
Each grid cell is a number between 1 and 12 but randomized so every number can be anywhere.

For instance: (example in the bottom-left side of the grid):

1___2___3___4

5___6___7___8

9__10__11__12

distance between cells 1 and 5 is 1
distance between cells 1 and 6 is 2
distance between cells 1 and 12 is 5

the grid can also be this and other randomized forms:
1___7___9___12

8___2___6___11

10__8___3___4

Is it possible to have the formula to be able to calculate all of the distance between 2 cells????

Thanks for any help in advance! :)

Formulas? No.

### RE: calculating the distance between cells in excel (randomize moving cells)

Actually, I might take that back.

If we're allowed to cheat.

### RE: calculating the distance between cells in excel (randomize moving cells)

With a set of MATCH formulas it is possible to find row and column of a given number in table, next x and y distances can be calculated using ABS.

combo

### RE: calculating the distance between cells in excel (randomize moving cells)

How are you wanting to identify the cells you are measuring between? If you know the cells (e.g B1 and D3) it is easy. If you want to identify the, from the numbers they contain (i.e find the distance between 12 and 7, no matter where they are in the array, then that's more difficult to do in a single formula)

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!