Substring function not working as expected

ufotje

New Member
Joined
Oct 23, 2020
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
I wrote a function to see if the value of a specific field contains a substring based on that it's suposed to do one of two things, this is the formula:
Excel Formula:
=IF(ISTEXT(SEARCH("Withdrawal for KNC*"; A7));E7+L6;L6)
, as you might be able to guess I wanna calculate all the withdrawals for KNC, E7 contains the amount L6 is the subtotal, so when the substring is found it should add E7 to L6 and write it in L7(the cell of the function), I wrote it in the first cell and then just pulled it down so it could autocomplete, the first 3 cell work great, but then I get unexpected behaviour, I was hoping someone could tell me why, online I see everyone searching for a substring with ISNUMBER instead of ISTEXT, but when I try that is returns false even when the substring is pressent.
These are some values to show what i mean with unexpected behaviour


Action (Column A)
(this is the field I search for the substring)
DateTimeStart BalanceAmount (Column E)
(this is the amount to be added)
New BalanceDescriptionTotal Withdrawals KNC
(Column L)
Deposit for KNC on Kucoin21 OCTOBER 202000:05:181300014488,5540427488,55404Buy0
Withdrawal for BTC on Kucoin21 OCTOBER 202000:05:183-12payed for KNC0
Withdrawal for KNC on Kucoin21 OCTOBER 202000:05:1827488,55404-14,4885540427474,06549TakerFee KNC-14,48855404
Withdrawal for KNC on Kucoin21 OCTOBER 202000:05:1827474,06549-2,8427471,22549WithdrawFee KNC-17,32855404
Withdrawal for KNC on Kucoin21 OCTOBER 202000:05:1827471,22549-14471,2254913000Transfer to Binance-14488,55404
Deposit for KNC on Binance21 OCTOBER 202000:05:181300014471,2254927471,22549Transfer from Kucoin-17,32855404
(unexpected value should be -14488,55404)
 
When I use seracht("", A4) it returns the substring starting from the second character
OK, that formula has all sorts of typos in it.
not the substring but the whole string;, when I then change it =ISNUMBER(SEARCH("With...", A7)) I get false
In your original formula, you used semi-colons as argument separators. Now you are using commas.
Which is it? Which one does your computer use.
Different versions of Excel around the world use different values for argument separators. The first thing you need to do is identify and understand which one your computer uses, and consistently use that one.

Then, let's test ONE single thing, and stop hopping around all over the place. Let's resolve one issue before moving to the rest.

So, what exactly does this formula return?
VBA Code:
=SEARCH("With",A7)
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
OK, that formula has all sorts of typos in it.

In your original formula, you used semi-colons as argument separators. Now you are using commas.
Which is it? Which one does your computer use.
Different versions of Excel around the world use different values for argument separators. The first thing you need to do is identify and understand which one your computer uses, and consistently use that one.

Then, let's test ONE single thing, and stop hopping around all over the place. Let's resolve one issue before moving to the rest.

So, what exactly does this formula return?
VBA Code:
=SEARCH("With",A7)
I didn't coppy the formula from excel, so the typo's are here ont he platform, not in excel, then it would give an error, I use ;
this formula =ZOEKEN("Withdrawal for KNC*"; A4), which is a simple search, returns ithdrawal for KNC on Kucoin
when i use vind.spec, I don't really know what the english version is find.spec?, it returns a 1
 
Upvote 0
This works as expected =ALS(ISGETAL(VIND.SPEC("Withdrawal for KNC*"; A4));E4+L3;L3), the english version would be IF(ISNUMBER(FIND.SPEC(("Withdrawal for KNC*"; A4));E4+L3;L3) i guess
 
Upvote 0
Note that when you are posting questions, it is important to give us all the important detail, such as you are using a different language version of Excel (not English).
Perhaps all those functions do not always translate over perfectly into other versions.

So plesase be sure to mention that in future posts.

Also notice that there is a "Questions in Other Languages" forum here: Questions in Other Languages, where you can post questions in your own native language.
 
Upvote 0
FYI
VIND.SPEC =SEARCH
ZOEKEN=LOOKUP

Two totally different functions.
 
Upvote 0
Note that when you are posting questions, it is important to give us all the important detail, such as you are using a different language version of Excel (not English).
Perhaps all those functions do not always translate over perfectly into other versions.

So plesase be sure to mention that in future posts.

Also notice that there is a "Questions in Other Languages" forum here: Questions in Other Languages, where you can post questions in your own native language.
I noticed there is a subforum in native languages, but I expect to get a answer faster in english, that was I posted here
 
Upvote 0
FYI
VIND.SPEC =SEARCH
ZOEKEN=LOOKUP

Two totally different functions.
Lol, that makes no sense at all, not meaning what you're saying isn't true, but the translation sucks, zoeken translated to english is literally search, Lookup would be opzoeken in dutch
 
Upvote 0
I noticed there is a subforum in native languages, but I expect to get a answer faster in english, that was I posted here
Well, that is fine to do, but that means it is up to you to make sure you are translating to the equivalent function on the other side.
Otherwise, the information you are giving us is faulty, and we have the situation like we did here.

Here is a list of the 100 most common Excel function and their Dutch name equivalents: Excel Functions in Dutch | Easy-Excel.com
 
Upvote 0
One way to ensure that you get the right functions is to use a translator like this one here

Helps to ensure there is no misunderstandings.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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