#1   Report Post  
Posted to microsoft.public.excel.misc
Brad1982
 
Posts: n/a
Default Search


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   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default Search

Sorry, you need to convert this to a value. Amended formula:

=VALUE(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1))

Pete

  #4   Report Post  
Posted to microsoft.public.excel.misc
Brad1982
 
Posts: n/a
Default Search


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   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
Brad1982
 
Posts: n/a
Default Search


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   Report Post  
Posted to microsoft.public.excel.misc
SteveG
 
Posts: n/a
Default Search


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   Report Post  
Posted to microsoft.public.excel.misc
Brad1982
 
Posts: n/a
Default Search


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   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default Search

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   Report Post  
Posted to microsoft.public.excel.misc
Brad1982
 
Posts: n/a
Default Search


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   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default Search

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I search excel spreadsheets using multiple search criteria. Kasper Excel Worksheet Functions 4 December 15th 05 12:26 AM
Search Entire Workbook Sloth Excel Discussion (Misc queries) 0 October 14th 05 05:12 AM
Search within workbook Mare New Users to Excel 3 October 10th 05 07:17 PM
Wildcard search functions within Vlookup Benn Excel Worksheet Functions 2 July 26th 05 01:12 PM
FAQ Spreadsheet with search function murphyz Excel Discussion (Misc queries) 0 March 19th 05 09:24 PM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"