Function like FIND or SEARCH???

xJimba1

New Member
Joined
May 22, 2011
Messages
4
Result = FIND("def","abcdefghiabcdef")

My task is to create a custom function in Excel, named XFIND(), that overcomes these limitations, as follows:

· The function should return 0 (zero) if the search string isn't found. This makes it much easier for the user to handle a failed search.

· Write the StartingPosition argument so that it searches for successive occurrences of a substring by occurrence number, without having to know the starting position of previous occurrence(s). In other words, to find the second occurrence of "abc" in the example above, the user would enter '2' as the starting position instead of ‘5,’ (one position past the first occurrence). XFIND() will return '10,’ just as FIND() and SEARCH() would do.

· The order of the arguments should be the same as FIND and SEARCH, to reduce confusion.

· Add a final optional argument that allows the user to specify case sensitivity.

I am having issues getting this to work properly
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Not really, just a task to show skill sets. I have tried this a few ways, but I'm not sure whats best. I'm not sure if I want to use a list of functions in the cell or do the work in vba. Just looking for the most appropriate way. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,445
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top