Excel Formula calulation **/**/001

Hi,

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.

Thanks
Gareth_PointonAsked:
Who is Participating?
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.....

=TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",LEN(A2))),LEN(A2)))

Open in new window


This will return 100.

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

=RIGHT(A2,3)

Open in new window

0
Gareth_PointonAuthor Commented:
Hi guys.

What is there is this format also..
***/****/01-99

Answer would be 99

Thanks
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

=TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A2,"/",REPT(" ",LEN(A2))),"-",REPT(" ",LEN(A2))),LEN(A2)))

Open in new window


Does this help?
0
Gareth_PointonAuthor Commented:
Hi.

That doesn’t work, gives me 15 instead of 8 for
 
14/0671/08-15

We need to know the sum of the difference between the numbers
0
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.
0
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?
0

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:
***/***/001
***/***/002
***/***/003
...
***/***/100

=MAX(RIGHT(A1:A6,3))-MIN(RIGHT(A1:A6,3))

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

Thanks
Rob H
0
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.
0
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.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.