2

I need to sort street addresses for people to walk on either side of the street. Therefore I need to order the even address numbers first, then the odd numbers.

I've already managed to sort by street name, but now how do I sort the data by evens and then odds within the streets?

4444
  • 3,541
  • 10
  • 32
  • 43
chuck_iv
  • 25
  • 1
  • 7

1 Answers1

0

Make a new formula called EvenOrOdd:

ToNumber({addressNumber}) MOD 2

This returns 0 when a number is even, and 1 when a number is odd. Then add a new Group inside your existing group and sort based on EvenOrOdd.

4444
  • 3,541
  • 10
  • 32
  • 43
  • "Then add a new Group inside your existing group and sort based on EvenOrOdd." Not sure what this means but thank you. I am RTFM now. I am working with an existing template but I don't think it was created properly in the first place which is why I am having trouble. The output I get is almost correct, but has issues when there is an apartment number, which shouldn't even be part of the address number sorting. – chuck_iv Aug 08 '16 at 18:20
  • If a group includes apartment number like 2043 place apt 6, is there a way to sort only by the first number and ignore the 6? – chuck_iv Aug 08 '16 at 18:21
  • Sure, you could write a formula to crop out everything after the first Space in your Apartment Number string, then convert the resulting string `2043` to a number value. Something like `Left(AddressField, Instr(1, AddressField, " ") - 1)` – 4444 Aug 08 '16 at 19:39
  • 1
    nevermind I got it sorted out. some of the numbers were being imported as strings, throwing off the sorting. we also had a convoluted way of calculating even/odd so changing that to mod 2 was super helpful thanks again – chuck_iv Aug 08 '16 at 20:03