Hi,
I have multiple cells with data like this: 6541/345/4862/13 in Cell A1, 1235/489/2136/59 in Cell A2 ...
Is there a formula to count only the "third" part of each cell?
In this example 4862 + 2136?
Anyone with a solution?
Thanks
Hi,
I have multiple cells with data like this: 6541/345/4862/13 in Cell A1, 1235/489/2136/59 in Cell A2 ...
Is there a formula to count only the "third" part of each cell?
In this example 4862 + 2136?
Anyone with a solution?
Thanks
What is it you are trying to count? How many numbers in 4682? Or you want to SUM 4682 from A1 and 2136 from A2?
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Alkey is right. You have not explained your requirement clearly.
So see if this helps.
Assuming your string is in A1, then
If you just want to return the third number in the string, try this in B1
If you want B1 to show the number of digits in the third number of the string, try this in B1Please Login or Register to view this content.
Please Login or Register to view this content.
Regards
sktneer
Treat people the way you want to be treated. Talk to people the way you want to be talked to.
Respect is earned NOT given.
I'm so sorry.
I mean I want to sum up the numbers.
So make the sum of each third part of the cell.
But keep in mind that this number is anywhere from 1 tot 5 digits.
If you show an example with data and the expected output it would become even more clear.
<----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left
If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.
Assuming there will always be 4 delimited numbers per cell...
Data Range
A B 1 6541/345/4862/13 7198 2 1235/489/2136/59 3 41887/20/200/100
This array formula** entered in B1:
=SUM(--TRIM(LEFT(RIGHT(SUBSTITUTE(A1:A3,"/",REPT(" ",100)),200),100)))
** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
Last edited by Tony Valko; 07-03-2014 at 03:46 PM.
Biff
Microsoft MVP Excel
Keep It Simple Stupid
Let's Go Pens. We Want The Cup.
Yes, so let's use this opportunity to look at the myth that array formulas are slower than normally entered formulas.
Tested these 2 formulas:
Array entered**:
=SUM(--TRIM(LEFT(RIGHT(SUBSTITUTE(A1:An,"/",REPT(" ",100)),200),100)))
** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
Normally entered:
=SUMPRODUCT(--TRIM(LEFT(RIGHT(SUBSTITUTE(A1:An,"/",REPT(" ",100)),200),100)))
Here are the calculation times (in seconds):
Data Range
C D E F G H I 1 100 rows Test1 Test2 Test3 Test4 Test5 Average 2 SUM array 0.00070 0.00071 0.00070 0.00071 0.00070 0.00070 3 SUMPRODUCT 0.00071 0.00070 0.00070 0.00070 0.00070 0.00070 4 5 1000 rows Test1 Test2 Test3 Test4 Test5 Average 6 SUM array 0.00535 0.00541 0.00551 0.00536 0.00536 0.00540 7 SUMPRODUCT 0.00547 0.00541 0.00537 0.00537 0.00541 0.00541
Used Charles Williams' range timer code which can be found here:
http://msdn.microsoft.com/en-us/library/aa730921.aspx
Last edited by Tony Valko; 07-03-2014 at 08:08 PM. Reason: corrected the URL
I don't think that the speed is an issue. It is the system resources that required to process array calculations which in turn may slow the entire calculation process down. What is more interesting is that Microsoft's recommendation to use SUMPRODUCT function when possible because "it is slightly faster than the equivalent array formula".
http://msdn.microsoft.com/en-us/libr...rraySumProduct
Last edited by Tony Valko; 07-04-2014 at 08:42 AM. Reason: added the missing word: the!
Actually I tend to prefer SUMPRODUCT when possible, not because I believe it is necessarily "faster" than the equivalent CSE version, but simply as it avoids potential issues re the OP coming back having obviously failed to heed the large, emboldened, asterisked instructions re array formulas that I include!
Cheers
Oke.
Thanks a lot for all the replies.
=SUM(--TRIM(LEFT(RIGHT(SUBSTITUTE(A1:An,"/",REPT(" ",100)),200),100))) seems to work for a fix number of cells.
But the thing is, I want to be able to edit and work with the cells.
I'll give more clarification:
CarAval.jpg
On the image, in the red box on the right, I want the sum of all the third parts of each cell in the red circle in the first cell (next to 1)
The same for 2, 3 and 4.
The first partof a cell is always 4 digits, the second always 3 and the last is always a date, so 8 digits.
I also want to be able to drag cells across the sheet, and the table will change as well.
If you need further clarification, don't hesitate because I'm fairly new to the world of forums
Can you post a SMALL sample that shows us what results you expect?
A SMALL file is one where we don't have to scroll to see the data!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks