#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default Formula Solution

Hi All,

Below formula works good except it seems like the result come as a text and
not as a number. Therefore, I can not calculate further. Txs for the help.

Dinesh Shah

=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 492
Default Formula Solution

Untested, but try this, the *1 on the end should force the text result of
the formula back into a number,
Regards,
Alan.
=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )*1
"Dinesh" wrote in message
...
Hi All,

Below formula works good except it seems like the result come as a text
and
not as a number. Therefore, I can not calculate further. Txs for the help.

Dinesh Shah

=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Formula Solution

If both IF Search functions error then they return an empty string so just
multiplying by 1 could cause a #VALUE! error:

Try this:

=TRIM(IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),0,MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE TYPE:BOOK",D3)),"
",MID(D3,SEARCH("REF:",D3)+4,5)+0))+0

This way if the first IF Search errors and the second IF Search does not the
leading 0 will get dropped. And in reverse, if the second IF Search errors
the trailing space gets trimmed off. If both IF Searches error the result
will be 0space with the space getting trimmed off leaving a 0.

The second error trap is a space just in case line wrap breaks the formula
at that point.

You'll no longer get a blank cell if both Search functions error. You'll get
0. You can conditionally format that out of sight if you want.

Biff

"Alan" wrote in message
...
Untested, but try this, the *1 on the end should force the text result of
the formula back into a number,
Regards,
Alan.
=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )*1
"Dinesh" wrote in message
...
Hi All,

Below formula works good except it seems like the result come as a text
and
not as a number. Therefore, I can not calculate further. Txs for the
help.

Dinesh Shah

=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Formula Solution

In addition, the inner +0's are no longer needed and I see line wrap broke
the formula at the space so here it is in chunks:

=TRIM(IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),
0,MID(D3,SEARCH("PMT DET:",D3)+8,5))
&IF(ISERROR(SEARCH("WIRE TYPE:BOOK",D3)),
" ",MID(D3,SEARCH("REF:",D3)+4,5)))+0

Biff

"Biff" wrote in message
...
If both IF Search functions error then they return an empty string so just
multiplying by 1 could cause a #VALUE! error:

Try this:

=TRIM(IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),0,MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE TYPE:BOOK",D3)),"
",MID(D3,SEARCH("REF:",D3)+4,5)+0))+0

This way if the first IF Search errors and the second IF Search does not
the leading 0 will get dropped. And in reverse, if the second IF Search
errors the trailing space gets trimmed off. If both IF Searches error the
result will be 0space with the space getting trimmed off leaving a 0.

The second error trap is a space just in case line wrap breaks the formula
at that point.

You'll no longer get a blank cell if both Search functions error. You'll
get 0. You can conditionally format that out of sight if you want.

Biff

"Alan" wrote in message
...
Untested, but try this, the *1 on the end should force the text result
of the formula back into a number,
Regards,
Alan.
=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )*1
"Dinesh" wrote in message
...
Hi All,

Below formula works good except it seems like the result come as a text
and
not as a number. Therefore, I can not calculate further. Txs for the
help.

Dinesh Shah

=IF(ISERROR(SEARCH("WIRE TYPE:WIRE",D3)),"",MID(D3,SEARCH("PMT
DET:",D3)+8,5)+0)&IF(ISERROR(SEARCH("WIRE
TYPE:BOOK",D3)),"",MID(D3,SEARCH("REF:",D3)+4,5)+0 )







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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Convert VBA solution to a formula Toppers Excel Discussion (Misc queries) 2 June 22nd 06 09:45 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM


All times are GMT +1. The time now is 06:35 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"