ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Variable Find (https://www.excelbanter.com/excel-discussion-misc-queries/215621-variable-find.html)

Joe Murphy[_2_]

Variable Find
 
I have a list of error messages that include text like << "field name"
must be entered in the following format dd-mm-yyyy.

I want to be able to trim the messages down to the << the must be
entered in the following format dd-mm-yyyy portion, removing the
<<" field name" bit. So I'm using something like:

=(FIND("field name", E4)),E4,RIGHT(E4,LEN(E4)-12)

This checks to see if it can find 'field name' and if it can, removes
the first 12 characters. Easy.

The problem is I only want this to happen if the _first part_ of the
string is 'field name'. So I don't want <<The first character of
"field name" must not be D,F,I,Q,U or V to match.

Apart from solutions based on the length of these error messages, is
there anything else I could try?

Thanks,

Joe.

Luke M

Variable Find
 
Maybe something like this:
=IF(LEFT(E4,10)="field name",RIGHT(E4,LEN(E4)-11),E4)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Joe Murphy" wrote:

I have a list of error messages that include text like << "field name"
must be entered in the following format dd-mm-yyyy.

I want to be able to trim the messages down to the << the must be
entered in the following format dd-mm-yyyy portion, removing the
<<" field name" bit. So I'm using something like:

=(FIND("field name", E4)),E4,RIGHT(E4,LEN(E4)-12)

This checks to see if it can find 'field name' and if it can, removes
the first 12 characters. Easy.

The problem is I only want this to happen if the _first part_ of the
string is 'field name'. So I don't want <<The first character of
"field name" must not be D,F,I,Q,U or V to match.

Apart from solutions based on the length of these error messages, is
there anything else I could try?

Thanks,

Joe.



All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com