# Randomise items and total their associated cell values

1. ## Randomise items and total their associated cell values

Hi,

I have a list of locations and distances for those locations. I wish to randomise 4 of those locations and sum their stances. I also wish to list the 4 random locations in one cell sperated by a comma.

I have the 4 random locations using the formulae =INDEX(\$A\$3:\$A\$24, RANDBETWEEN(1, ROWS(\$A\$3:\$A\$24)))

For example:

Destination Distance

Location 1 12 Location 2 [Formulae for Total Distance of those 4 Locations]
Location 2 9 Location 7
Location 3 4 Location 1
Location 4 30 Location 5
Location 5 20
Location 6 17 [4 Random Locations in one cell seperated by a comma]
Location 7 19

I would appreciate any help.

Thanks,
Verifyor

2. ## Re: Randomise items and total their associated cell values

To list your four locations, use this:
Formula:
`Please Login or Register  to view this content.`

If you want a comma and space, just put a space after each comma.

For the summed distances, try this:
Formula:
`Please Login or Register  to view this content.`

3. ## Re: Randomise items and total their associated cell values

Total Distance for those 4 Locations:

=SUMPRODUCT(SUMIF(A3:A24,C3:C6,B3:B24))

4. ## Re: Randomise items and total their associated cell values

Thank you very much for your help Aardigspook & Phuocam!

5. ## Re: Randomise items and total their associated cell values

if you want to randomize and concatenate in multiple cells and sum their adjacent values:

in C3:
``Please Login or Register  to view this content.``
in D3:
``Please Login or Register  to view this content.``

6. ## Re: Randomise items and total their associated cell values

Thanks Paul I will try use the formulae to randomise & concentrate in multiple cells with adjacent totals.

7. ## Re: Randomise items and total their associated cell values

Glad we could help and thanks for marking the thread as Solved.

There are currently 1 users browsing this thread. (0 members and 1 guests)