#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Marc
 
Posts: n/a
Default Find and Length

Hello - In my example I have 3 cells that have a combination of letters and
numbers. I want to extract the numbers and total them in my formula cell.
The formula below works, but I'm looking for a way to use a variable to
extract the lenght of the number instead of hard coding the length. 156,400
and 394,450 are each 7, but 53,000 is only 6.

Thanks for any help you can give.

F4 - 200 @ 782 = 156,400 50 - target changes 60 - mgmt changes 90 -
discretionary

F5 - 575 @ 686 = 394,450 (partnership)
F6 - 50 @ 1060 = 53,000 (full service) 22,000 units x $38/1000 SGI - 32
hours x 7/hour

FORMULA -
=text(sum(mid(f4,find("=",f4)+2,7)+(mid(f5,find("= ",f5)=2,7)))=(mid(f6,find("=",f6)+2,6)),"0,000 ")


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
 
Posts: n/a
Default Find and Length

Marc,

Replace the 7s and 6s with FIND(",",F4)-FIND("=",F4)+2

for each cell.

HTH,
Bernie
MS Excel MVP


"Marc" wrote in message
...
Hello - In my example I have 3 cells that have a combination of letters and
numbers. I want to extract the numbers and total them in my formula cell.
The formula below works, but I'm looking for a way to use a variable to
extract the lenght of the number instead of hard coding the length. 156,400
and 394,450 are each 7, but 53,000 is only 6.

Thanks for any help you can give.

F4 - 200 @ 782 = 156,400 50 - target changes 60 - mgmt changes 90 -
discretionary

F5 - 575 @ 686 = 394,450 (partnership)
F6 - 50 @ 1060 = 53,000 (full service) 22,000 units x $38/1000 SGI - 32
hours x 7/hour

FORMULA -
=text(sum(mid(f4,find("=",f4)+2,7)+(mid(f5,find("= ",f5)=2,7)))=(mid(f6,find("=",f6)+2,6)),"0,000 ")




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default Find and Length

If you really need to, use =MID(F4,FIND("=",F4)+2,FIND("
",F4,FIND("=",F4)+2)-FIND("=",F4)-2)
etc

Why bother, the formula works as is. But you do not need the SUM; try
=TEXT((MID(F4,FIND("=",F4)+2,7)+(MID(F5,FIND("=",F 5)+2,7)))+(MID(F6,FIND("=",F6)+2,6)),"0,000")

Alternatively, this works for me
=--(MID(F4,FIND("=",F4)+2,7))+--MID(F5,FIND("=",F5)+2,7)--MID(F6,FIND("=",F6)+2,7)
then format the cell to display thousands separator
The double negations change text to number
The last one becomes "53000 " but when turned into a number the trailing
space disappears
It would not work if the value had less than 6 or more than 7 characters
(digits plus comma)
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Marc" wrote in message
...
Hello - In my example I have 3 cells that have a combination of letters
and
numbers. I want to extract the numbers and total them in my formula cell.
The formula below works, but I'm looking for a way to use a variable to
extract the lenght of the number instead of hard coding the length.
156,400
and 394,450 are each 7, but 53,000 is only 6.

Thanks for any help you can give.

F4 - 200 @ 782 = 156,400 50 - target changes 60 - mgmt changes 90 -
discretionary

F5 - 575 @ 686 = 394,450 (partnership)
F6 - 50 @ 1060 = 53,000 (full service) 22,000 units x $38/1000 SGI - 32
hours x 7/hour

FORMULA -
=text(sum(mid(f4,find("=",f4)+2,7)+(mid(f5,find("= ",f5)=2,7)))=(mid(f6,find("=",f6)+2,6)),"0,000 ")




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sloth
 
Posts: n/a
Default Find and Length

=TEXT(SUMPRODUCT(VALUE(LEFT(RIGHT(F4:F6,LEN(F4:F6)-FIND("=",F4:F6)-1),FIND("
",RIGHT(F4:F6,LEN(F4:F6)-FIND("=",F4:F6)-1))))),"0,000")

"Marc" wrote:

Hello - In my example I have 3 cells that have a combination of letters and
numbers. I want to extract the numbers and total them in my formula cell.
The formula below works, but I'm looking for a way to use a variable to
extract the lenght of the number instead of hard coding the length. 156,400
and 394,450 are each 7, but 53,000 is only 6.

Thanks for any help you can give.

F4 - 200 @ 782 = 156,400 50 - target changes 60 - mgmt changes 90 -
discretionary

F5 - 575 @ 686 = 394,450 (partnership)
F6 - 50 @ 1060 = 53,000 (full service) 22,000 units x $38/1000 SGI - 32
hours x 7/hour

FORMULA -
=text(sum(mid(f4,find("=",f4)+2,7)+(mid(f5,find("= ",f5)=2,7)))=(mid(f6,find("=",f6)+2,6)),"0,000 ")


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
UNC Path length problem opening a file in excel 2002 or 2003 John Excel Discussion (Misc queries) 3 October 14th 05 03:43 AM
Excel - Find a value in a Table !!??!! herve Excel Discussion (Misc queries) 1 September 16th 05 11:47 AM
calculate the number of words in a row whose length is greater than 2 sks1379 Excel Worksheet Functions 5 September 4th 05 06:21 PM
find radius from chord length kimtp Excel Discussion (Misc queries) 4 June 2nd 05 06:40 PM
Search a Column by text length kb_63 Excel Worksheet Functions 2 May 6th 05 09:17 PM


All times are GMT +1. The time now is 12:09 AM.

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

About Us

"It's about Microsoft Excel"