Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am using a MID function to extract numbers from a string:
=--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=IF(ISNUMBER(FIND("/",A1)),--MID(A1,1,FIND("/",A1)-1),A1)
-- Regards, Peo Sjoblom "RhysPieces" wrote in message ... I am using a MID function to extract numbers from a string: =--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=IF(ISERROR(MID(A1,1,FIND("/",A1)-1)),"")
-- Elisabeth "RhysPieces" wrote: I am using a MID function to extract numbers from a string: =--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here's one way:
=IF(ISERR(FIND("/",A1)),"",--MID(A1,1,FIND("/",A1)-1)) Or: =IF(ISERR(FIND("/",A1)),"",--LEFT(A1,FIND("/",A1)-1)) -- Biff Microsoft Excel MVP "RhysPieces" wrote in message ... I am using a MID function to extract numbers from a string: =--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Disregard my answer--it won't work--sorry.
-- Elisabeth "Elisabeth" wrote: =IF(ISERROR(MID(A1,1,FIND("/",A1)-1)),"") -- Elisabeth "RhysPieces" wrote: I am using a MID function to extract numbers from a string: =--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The solutions from T. Valko and Peo Sjoblom work equally well. Thanks to both
for prompt replies. "T. Valko" wrote: Here's one way: =IF(ISERR(FIND("/",A1)),"",--MID(A1,1,FIND("/",A1)-1)) Or: =IF(ISERR(FIND("/",A1)),"",--LEFT(A1,FIND("/",A1)-1)) -- Biff Microsoft Excel MVP "RhysPieces" wrote in message ... I am using a MID function to extract numbers from a string: =--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You're welcome. Thanks for the feedback!
-- Biff Microsoft Excel MVP "RhysPieces" wrote in message ... The solutions from T. Valko and Peo Sjoblom work equally well. Thanks to both for prompt replies. "T. Valko" wrote: Here's one way: =IF(ISERR(FIND("/",A1)),"",--MID(A1,1,FIND("/",A1)-1)) Or: =IF(ISERR(FIND("/",A1)),"",--LEFT(A1,FIND("/",A1)-1)) -- Biff Microsoft Excel MVP "RhysPieces" wrote in message ... I am using a MID function to extract numbers from a string: =--MID(A1,1,FIND("/",A1)-1) If the string does not contain "/", it results in the #VALUE! error. What code needs to go in front of the formula to trap this and return ""? Thank you for your replies. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
trapping charts event | Charts and Charting in Excel | |||
Error Trapping from WSH | Excel Discussion (Misc queries) | |||
Chart Events - Trapping arrow key strokes | Charts and Charting in Excel | |||
error trapping | Excel Discussion (Misc queries) | |||
trapping for printer problems | Charts and Charting in Excel |