I have had this sub-type as well.
For me, the counting with OCD is always related to keeping something bad from happening. Or I'd find myself counting in my head when I was stressed or freaking out. I'm not obsessed with numbers, it just became a way to comfort myself somehow.
I don't do it that much anymore, but when I think back on when I did, it was a compulsion I used. Sometimes too you'll find yourself branching out in other ways with counting or numbers, like you'll come up with some number (probably you got relief from a thought when you happened to be counting to that number) that you'll then start to view it as your 'go to' number. Then it'll be like you have to do something now that many times to make everything ok.
You may have more than one number. Or you may have a number or numbers that you avoid because you associate it with something bad. Like maybe you avoid 3 because someone you loved died on the 3rd of a month. Or if you've become scared of so called bad numbers, like 13. Whatever the case, this is slowly going to drive you insane if you keep giving in to it. And it is SO hard, I know.
For ordering things, or needing things lined up straight or at a certain angle, I have found the same theory with the counting applies(at least in my case). I would do it to feel like things would be ok, someone would be safe or something similar. Or a bad thought would run through my mind as I was putting something down, so I'd have to keep picking it up and putting it down until I could think a better thought while I was doing it.
For me it wasn't because I needed everything just so. One thing I HATE is when people say 'oh I'm just being OCD' when they have to have something straightened or situated a certain way. That is NOT what OCD is. We're not just neat freaks and anal over everything, it's the underlying issue of fear that is causing us to irrationally do things like this, not because we're perfectionists.
Actually OCPD is what they're thinking about, not OCD. OCPD is Obsessive Compulsive Personality Disorder, and is a totally different thing. Those with OCPD usually enjoy the way they are and aren't distressed by thoughts of harm and death or danger, they just like their things the way they want them, and they will go to great lengths to make them stay that way. It's totally different.
Anyway, I digress.
How to fix it
One thing to know when dealing with these sub-types, is when you think about it, OCD is VERY superstitious. Even if you aren't a superstitious person, the actions OCD cause us to do are in the nature of being superstitious.
Superstitions are not real. There has never been a case of someone being harmed by a superstitious thought. Unless they harmed themselves because of the distress or fear..but it never took place solely because they had the thought and didn't compulse on it. It's really ridiculous. And it'll never stop until you stop giving in to it. This is going to be hard as well.
Have you picked up a theme yet with OCD? LOL It's SO hard. It's hard living with it and it's hard fighting it. But it can be done. You've already proved you're an amazingly strong person just by living with this mess. You can do this!
When these sub-types come up for me, I've gotten to where I like to think 'ok, OCD says to do this, then I'm going to do the opposite of what it said', and you do this by ignoring whatever OCD is urging you to do.
When has OCD ever been right about something? Never, because the OCD is just your brain glitching. It is NOT some unknown, higher power controlling your brain and able to affect outside things, like other people and situations. It's just not.
When you try to look at it from a scientific standpoint and not a superstitious one, it becomes more harmless in your eyes and really starts to look like a brain misfiring, because that is all it is.
Find the dedicated page for this topic here: Counting and Ordering