Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() This is way beyond my skill level so I decided to come here first. I need to search within a cell and add up all of the numbers. The problem is the numbers lie within text A1 contains this: Green(17) Red(12) Blue(16) Orange(230) So the search function would add up all the numbers of the cell and return 275 -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Assuming your values are in A1 to A4, type this formula into B1 and
copy down: =MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1) Sum these values to get 275. Hope this helps, Pete |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry, you need to convert this to a value. Amended formula:
=VALUE(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1)) Pete |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Pete Wrote: Sorry, you need to convert this to a value. Amended formula: =VALUE(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1)) Pete All of the values are in one single cell, not A1 to A4. That is what is stumping me actually :). -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry (again), I misunderstood. I'll have a think while I have
something to eat. Do you have similar entries in A2 and down, or is the problem just a one-off? Pete |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I havent gotten any real working formulas myself in the hour or so I put into it. I have several cells like this I would like to calc for. The reasoning behind this is a schedule vs capacity sort of thing. Rather then add up the individual values in a cell I would just like to have something calc them for me. It also takes out the human error problem. Thanks for your help Pete! I hope you can figure something out :-) -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() This will work for this one cell but it's a lot of maintenance if you have the need to sum the same type of data in A2, A3 and A4. =SUM(VALUE(MID(A1,FIND("(",A1,1)+1,2))+VALUE(MID(A 1,FIND("R",A1,1)+FIND("(",A1,1)-2,FIND(")",A1,1)-7))+VALUE(MID(A1,FIND("B",A1,1)+5,FIND(")",A1,1)-7))+VALUE(MID(A1,FIND("O",A1,1)+7,FIND("(",A1,1)-3))) You can't just copy this down. If you have data in A2, A3 and so on that you wish to perform this function on, the data has to be identical meaning in A2 it needs to be in the same order (Green,Red,Blue,Orange) and have the same type of numeric value i.e. Orange always needs to be in the hundreds, the others always have to be 2 digits. If your data is not identical say in A2the first line = Green(116). You have increased the number of characters by 1 so all of the formulas above need to be adjusted so it would look like. =SUM(VALUE(MID(A3,FIND("(",A3,1)+1,3))+VALUE(MID(A 3,FIND("R",A3,1)+FIND("(",A3,1)-2,FIND(")",A3,1)-8))+VALUE(MID(A3,FIND("B",A3,1)+5,FIND(")",A3,1)-8))+VALUE(MID(A3,FIND("O",A3,1)+7,FIND("(",A3,1)-4))) Notice the last number that you are adding to the FIND function in each is increased by 1. If Blue changes to 3 characters, you only have to change from the 3rd formula on. In any event, like I said, it's a lot of maintenance. HTH Steve -- SteveG ------------------------------------------------------------------------ SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() SteveG Wrote: This will work for this one cell but it's a lot of maintenance if you have the need to sum the same type of data in A2, A3 and A4. =SUM(VALUE(MID(A1,FIND("(",A1,1)+1,2))+VALUE(MID(A 1,FIND("R",A1,1)+FIND("(",A1,1)-2,FIND(")",A1,1)-7))+VALUE(MID(A1,FIND("B",A1,1)+5,FIND(")",A1,1)-7))+VALUE(MID(A1,FIND("O",A1,1)+7,FIND("(",A1,1)-3))) You can't just copy this down. If you have data in A2, A3 and so on that you wish to perform this function on, the data has to be identical meaning in A2 it needs to be in the same order (Green,Red,Blue,Orange) and have the same type of numeric value i.e. Orange always needs to be in the hundreds, the others always have to be 2 digits. If your data is not identical say in A2the first line = Green(116). You have increased the number of characters by 1 so all of the formulas above need to be adjusted so it would look like. =SUM(VALUE(MID(A3,FIND("(",A3,1)+1,3))+VALUE(MID(A 3,FIND("R",A3,1)+FIND("(",A3,1)-2,FIND(")",A3,1)-8))+VALUE(MID(A3,FIND("B",A3,1)+5,FIND(")",A3,1)-8))+VALUE(MID(A3,FIND("O",A3,1)+7,FIND("(",A3,1)-4))) Notice the last number that you are adding to the FIND function in each is increased by 1. If Blue changes to 3 characters, you only have to change from the 3rd formula on. In any event, like I said, it's a lot of maintenance. HTH Steve The values of the colors are almost never the same and the colors are always different. Some days it might even be BlueGray or LightOrange(283982). I will try messing around with that formula and see if I can come up with anything. Thanks! -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
ASAP Utilities, a free Add-in available at www.asap-utilities.com has
features that will strip all the TEXT characters and parenthesis out of the cell, leaving just the numbers separated by the CHAR(10) character...........I tried then using the TEXT functions to sum the numbers but it gets unwieldly quickly, and if you have as many as 20 in a cell, it would be even more difficult, perhaps exceeding the legal number of characters in a formula. But maybe this avenue might give someone else an idea how to sum the numbers...........of course splitting them out with Data TextToColumns would make it easier, but the OP has reasons not to want to do it that way.............. Vaya con Dios, Chuck, CABGx3 "Brad1982" wrote: This is way beyond my skill level so I decided to come here first. I need to search within a cell and add up all of the numbers. The problem is the numbers lie within text A1 contains this: Green(17) Red(12) Blue(16) Orange(230) So the search function would add up all the numbers of the cell and return 275 -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If anyone knows how to do FindAndReplace for the CHAR(10) character, to
replace it with + signs, after stripping it as I described in my previous post, then just add an equal sign to the front and your got the sum of the cell regardless of how many there are.............. Vaya con Dios, Chuck, CABGx3 "CLR" wrote: ASAP Utilities, a free Add-in available at www.asap-utilities.com has features that will strip all the TEXT characters and parenthesis out of the cell, leaving just the numbers separated by the CHAR(10) character...........I tried then using the TEXT functions to sum the numbers but it gets unwieldly quickly, and if you have as many as 20 in a cell, it would be even more difficult, perhaps exceeding the legal number of characters in a formula. But maybe this avenue might give someone else an idea how to sum the numbers...........of course splitting them out with Data TextToColumns would make it easier, but the OP has reasons not to want to do it that way.............. Vaya con Dios, Chuck, CABGx3 "Brad1982" wrote: This is way beyond my skill level so I decided to come here first. I need to search within a cell and add up all of the numbers. The problem is the numbers lie within text A1 contains this: Green(17) Red(12) Blue(16) Orange(230) So the search function would add up all the numbers of the cell and return 275 -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Ok, first delete all TEXT characters using ASAP Utilities
Then delete the leading and trailing parenthesis using ASAP Utilities Then do Edit Replace and in the "Replace" window hold down the ALT key and type 010 on the keypad with the NumLock on and in the "Replace with" window put a + sign....and do replace all Then add an = sign to the front of the string and perss enter.....it will sum the numbers Vaya con Dios, Chuck, CABGx3 "CLR" wrote: If anyone knows how to do FindAndReplace for the CHAR(10) character, to replace it with + signs, after stripping it as I described in my previous post, then just add an equal sign to the front and your got the sum of the cell regardless of how many there are.............. Vaya con Dios, Chuck, CABGx3 "CLR" wrote: ASAP Utilities, a free Add-in available at www.asap-utilities.com has features that will strip all the TEXT characters and parenthesis out of the cell, leaving just the numbers separated by the CHAR(10) character...........I tried then using the TEXT functions to sum the numbers but it gets unwieldly quickly, and if you have as many as 20 in a cell, it would be even more difficult, perhaps exceeding the legal number of characters in a formula. But maybe this avenue might give someone else an idea how to sum the numbers...........of course splitting them out with Data TextToColumns would make it easier, but the OP has reasons not to want to do it that way.............. Vaya con Dios, Chuck, CABGx3 "Brad1982" wrote: This is way beyond my skill level so I decided to come here first. I need to search within a cell and add up all of the numbers. The problem is the numbers lie within text A1 contains this: Green(17) Red(12) Blue(16) Orange(230) So the search function would add up all the numbers of the cell and return 275 -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#12
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Chuck
Nice solution. However, for some reason, EditReplace would not work for me with ALT 010, or SPACE when trying to insert the + signs. Any ideas why? -- Regards Roger Govier "CLR" wrote in message ... Ok, first delete all TEXT characters using ASAP Utilities Then delete the leading and trailing parenthesis using ASAP Utilities Then do Edit Replace and in the "Replace" window hold down the ALT key and type 010 on the keypad with the NumLock on and in the "Replace with" window put a + sign....and do replace all Then add an = sign to the front of the string and perss enter.....it will sum the numbers Vaya con Dios, Chuck, CABGx3 "CLR" wrote: If anyone knows how to do FindAndReplace for the CHAR(10) character, to replace it with + signs, after stripping it as I described in my previous post, then just add an equal sign to the front and your got the sum of the cell regardless of how many there are.............. Vaya con Dios, Chuck, CABGx3 "CLR" wrote: ASAP Utilities, a free Add-in available at www.asap-utilities.com has features that will strip all the TEXT characters and parenthesis out of the cell, leaving just the numbers separated by the CHAR(10) character...........I tried then using the TEXT functions to sum the numbers but it gets unwieldly quickly, and if you have as many as 20 in a cell, it would be even more difficult, perhaps exceeding the legal number of characters in a formula. But maybe this avenue might give someone else an idea how to sum the numbers...........of course splitting them out with Data TextToColumns would make it easier, but the OP has reasons not to want to do it that way.............. Vaya con Dios, Chuck, CABGx3 "Brad1982" wrote: This is way beyond my skill level so I decided to come here first. I need to search within a cell and add up all of the numbers. The problem is the numbers lie within text A1 contains this: Green(17) Red(12) Blue(16) Orange(230) So the search function would add up all the numbers of the cell and return 275 -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#13
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Roger.......I use XL97 at work where I developed the solution and am
at home now with XL2k and tried it again and it worked fine.......are you sure you have the NumLock on when doing the Replace and typing the 010 on the Keypad?...........did you enter the data with Alt-Enter?.....do you have "CellView" add-in to see what hidden characters are actually there? Vaya con Dios, Chuck, CABGx3 "Roger Govier" wrote in message ... Hi Chuck Nice solution. However, for some reason, EditReplace would not work for me with ALT 010, or SPACE when trying to insert the + signs. Any ideas why? -- Regards Roger Govier "CLR" wrote in message ... Ok, first delete all TEXT characters using ASAP Utilities Then delete the leading and trailing parenthesis using ASAP Utilities Then do Edit Replace and in the "Replace" window hold down the ALT key and type 010 on the keypad with the NumLock on and in the "Replace with" window put a + sign....and do replace all Then add an = sign to the front of the string and perss enter.....it will sum the numbers Vaya con Dios, Chuck, CABGx3 "CLR" wrote: If anyone knows how to do FindAndReplace for the CHAR(10) character, to replace it with + signs, after stripping it as I described in my previous post, then just add an equal sign to the front and your got the sum of the cell regardless of how many there are.............. Vaya con Dios, Chuck, CABGx3 "CLR" wrote: ASAP Utilities, a free Add-in available at www.asap-utilities.com has features that will strip all the TEXT characters and parenthesis out of the cell, leaving just the numbers separated by the CHAR(10) character...........I tried then using the TEXT functions to sum the numbers but it gets unwieldly quickly, and if you have as many as 20 in a cell, it would be even more difficult, perhaps exceeding the legal number of characters in a formula. But maybe this avenue might give someone else an idea how to sum the numbers...........of course splitting them out with Data TextToColumns would make it easier, but the OP has reasons not to want to do it that way.............. Vaya con Dios, Chuck, CABGx3 "Brad1982" wrote: This is way beyond my skill level so I decided to come here first. I need to search within a cell and add up all of the numbers. The problem is the numbers lie within text A1 contains this: Green(17) Red(12) Blue(16) Orange(230) So the search function would add up all the numbers of the cell and return 275 -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#14
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I managed to do this by using a separate sheet, though it's not very
pretty. Assuming the data is in Sheet1, insert a new sheet - I assume this is Sheet2. To help keep track of what's going on, I used headings in row1 of Sheet 2, as follows: B1 = Sum, C1 = Count, D1 = Start, then in E1 to X1 I filled the sequence 1 to 20, and in Y1 to AR1 I also put the sequence 1 to 20. Then the following formulae: B2: =SUM(Y2:AR2) C2: =COUNT(E2:X2) D2: 0 E2: =SEARCH(") ",TRIM(Sheet1!$A1)&" ",D2+1) This is copied across to X2 Y2: =IF(ISERROR(E2),0,VALUE(MID(TRIM(Sheet1!$A1),SEARC H("(",TRIM(Sheet1!$A1),D2+1)+1,E2-SEARCH("(",TRIM(Sheet1!$A1),D2+1)-1))) This is copied across to AR2. The cells B2 to AR2 can then be copied down for as many rows as necessary. The following formula is entered in Sheet1 Cell B1 (i.e. next to the cell we want to analyse): =Sheet2!B2 and this is copied down as necessary. I tested it with this in Sheet1 A2: black(0) brown(1) red(2) orange(3) yellow(4) green(5) blue(6) indigo(7) violet(8) white(9) purple(10) and with this in A3: black(0) brown(1) red(2) orange(3) yellow(4) green(5) blue(6) indigo(7) violet(8) white(9) purple(10) cyan(11) magenta(12) turquoise(13) puce(14) ochre(15) pink(16) lightgrey(17) silver(18) gold(19) It doesn't matter if you have multiple spaces between colours, or at the end of the string. It will cater for up to 20 colours - you get #VALUE errors in columns E to X if there are fewer, though this doesn't matter. The number of colours is counted in column C of Sheet2. Bit of a sledgehammer to crack a nut, but ... Hope this helps. Pete |
#15
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Pete Wrote: I managed to do this by using a separate sheet, though it's not very pretty. Assuming the data is in Sheet1, insert a new sheet - I assume this is Sheet2. To help keep track of what's going on, I used headings in row1 of Sheet 2, as follows: B1 = Sum, C1 = Count, D1 = Start, then in E1 to X1 I filled the sequence 1 to 20, and in Y1 to AR1 I also put the sequence 1 to 20. Then the following formulae: B2: =SUM(Y2:AR2) C2: =COUNT(E2:X2) D2: 0 E2: =SEARCH(") ",TRIM(Sheet1!$A1)&" ",D2+1) This is copied across to X2 Y2: =IF(ISERROR(E2),0,VALUE(MID(TRIM(Sheet1!$A1),SEARC H("(",TRIM(Sheet1!$A1),D2+1)+1,E2-SEARCH("(",TRIM(Sheet1!$A1),D2+1)-1))) This is copied across to AR2. The cells B2 to AR2 can then be copied down for as many rows as necessary. The following formula is entered in Sheet1 Cell B1 (i.e. next to the cell we want to analyse): =Sheet2!B2 and this is copied down as necessary. I tested it with this in Sheet1 A2: black(0) brown(1) red(2) orange(3) yellow(4) green(5) blue(6) indigo(7) violet(8) white(9) purple(10) and with this in A3: black(0) brown(1) red(2) orange(3) yellow(4) green(5) blue(6) indigo(7) violet(8) white(9) purple(10) cyan(11) magenta(12) turquoise(13) puce(14) ochre(15) pink(16) lightgrey(17) silver(18) gold(19) It doesn't matter if you have multiple spaces between colours, or at the end of the string. It will cater for up to 20 colours - you get #VALUE errors in columns E to X if there are fewer, though this doesn't matter. The number of colours is counted in column C of Sheet2. Bit of a sledgehammer to crack a nut, but ... Hope this helps. Pete awesome!!!!!! Pete you rock! CLR I also installed those addins and already can see some uses for some of the functions. Thanks a ton guys! -- Brad1982 ------------------------------------------------------------------------ Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690 View this thread: http://www.excelforum.com/showthread...hreadid=501093 |
#16
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for the feedback, glad to be of help.
I think I might install those free add-ins, Chuck. Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I search excel spreadsheets using multiple search criteria. | Excel Worksheet Functions | |||
Search Entire Workbook | Excel Discussion (Misc queries) | |||
Search within workbook | New Users to Excel | |||
Wildcard search functions within Vlookup | Excel Worksheet Functions | |||
FAQ Spreadsheet with search function | Excel Discussion (Misc queries) |