Excel Formula calulation **/**/001


We have numbers in the format of ***/**/****

We are trying to calculate the the end group.

So if its ***/***/001 to ***/***/100 then the calculation will be 100 records.

Hope this is clear.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Assuming that your string is in A2, then try this.....


Open in new window

This will return 100.

Is this what you are trying to achieve?
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Also if your end group is always of 3 digits, you may simply use......


Open in new window

Gareth_PointonAuthor Commented:
Hi guys.

What is there is this format also..

Answer would be 99

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
This will work for both "/" or "-" before the end group....


Open in new window

Does this help?
Gareth_PointonAuthor Commented:

That doesn’t work, gives me 15 instead of 8 for

We need to know the sum of the difference between the numbers
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
That's a new twist.
Earlier I was trying to extract the end group irrespective of the start group.
It would be helpful if you can provide some examples of your possible complete strings.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Considering the sample of strings you have provided so far, assuming your string is in A2, then try this....

=IF(ISNUMBER(SEARCH(" to ",A2)),TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",100)),100))-TRIM(RIGHT(SUBSTITUTE(LEFT(A2,SEARCH(" to ",A2)-1),"/",REPT(" ",100)),100))+1,TRIM(RIGHT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",100)),100)),"-",REPT(" ",100)),100))-TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",100)),100)),"-",REPT(" ",100)),100))+1)

Open in new window

Do you get the desired output now?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob HensonFinance AnalystCommented:
For formats:


Confirm entry with Ctrl + Shift  + Enter. Confirming with CSE will put {  } around the formula.

Rob H
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
I maybe wrong but I doubt if Rob got the question correctly.

Obviously this is not for the points but if you are closing a question, you should also keep an eye at the various solutions provided by the experts considering the question asked if OP has not responded and should propose the splitting based on the working solution, not just based on irrelevant solutions.

Food for thought.
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.