What's wrong with this Excel code involving IFs? - if-statement

=IF(B33=I33,K33,IF(B33=I34,K34,IF(B33=I35,K35)))*1000+(D33)/(C33)
The code works fine as this:
=IF(B33=I33,K33,IF(B33=I34,K34,IF(B33=I35,K35)))*1000+(D33)
But I want to afterwards divide the figure by the value in C33. I have tried multiple ways of including the / C33 but they all add up to the wrong value or give errors.

Your brackets are in the wrong place:
=(IF(B33=I33,K33,IF(B33=I34,K34,IF(B33=I35,K35)))*1000+D33)/C33
^ ^
Key ones highlighted. Note that you will get errors if the value in C33 is zero...

Related

Using IFS and REGEXMATCH Fails

I'm trying to use the following IFS statement
=IFS(REGEXMATCH(B2,"football"),"brown",REGEXMATCH(B2,"baseball"),"white")
but Google Sheets keeps saying the syntax is wrong. What is wrong with this?
Column B is a text column.
Other similar posts did not work for me.
The formula works fine.
You probably need to change it (depending on your locale) to:
=IFS(REGEXMATCH(D2;"football");"brown";REGEXMATCH(D2;"baseball");"white")
Another improvement you may make is to wrap it in the IFNA function
=IFNA(IFS(REGEXMATCH(D2,"football"),"brown",REGEXMATCH(D2,"baseball"),"white"),"No match")

TO_PURE_TEXT with cell referencing doesn't filter double quotes against documentation

I want to get a clean number from a string like "123.45". On using of =TO_PURE_TEXT(C10) it doesn't work for me,
against an example from the documentation. An absolute referencing doesn't help.
But, if i use no cell referencing, but direct input, like =TO_PURE_TEXT("123.45") the input is correct, as expected without quotes.
Is it a kind of bug, or do i really do something wrong? How can i get this work with the cell referencing?
all you need is:
=SUBSTITUTE(C10, """", )*1
or:
=REGEXREPLACE(C10, """", )*1
I can't speak to whether it's a bug. Does seem odd, but this should work for now:
=1*SUBSTITUTE(C10,CHAR(34),"")

Why REGEX_COUNT with semicolon doesn't work?

I'm trying to count the number of semicolon separated values in OBIEE.
I'm using the following formula: EVALUATE('REGEXP_COUNT(%1, '';'')', "Bibliographic Details"."Title") It returns an error:
When I try to use the same formula but change the '';'' with say ''a'' everything works as expected.
I don't recall semicolon being a saved character in REGEX so it's weird to me.
What I did eventually that gave me the required result:
EVALUATE('REGEXP_COUNT(%1, ''\;'')', "Bibliographic Details"."Title")
For some reason the "\" before the ";" fixed the problem.

How to put format code the right way in Python?

I try to learn Python via LPTHW (Learn Python The Hard Way), on the ex05 (its about format code), the code that he give isn't working, I need to use different code to get the same result.
I already tried deleting the parentheses, give space between f and the double quote.
At last I use the % (%s and %d) not the f (f"bla bla {bla}") one
What LPTHW expect is the first code to give the same result as the second one, yet it give me invalid syntax. There's no way the computer wrong right?
So what is the problem? Because when I try to find this problem, no one have the same problem as me.
I'm sure I type it right, because after that I tried to copy the exact code from the page and it still not working.

REGEXMATCH and MATCH don't work when a cell contains a number

I am trying to use formulas to find a row in my google spreadsheet document, however I have got a weird problem.
I am not able to find values when a cell contains a number (without any other characters).
Consider the following case
I have got two values
A1 - 32323232323
A2 - 323-23232-323
When I use the following formula
=FILTER(A:E,REGEXMATCH(B:B,"323-23232-323"))
It works fine, it successfully finds A2 value, however when I try to use the following formula
=FILTER(A:E,REGEXMATCH(B:B,"32323232323"))
It doesn't match any row, and I also tried the following formula
ADDRESS(MATCH("32323232323",B:B,0),1)
It doesn't work either, it only works when I remove quotes like that
ADDRESS(MATCH(32323232323,B:B,0),1)
But this doesn't work with REGEXMATCH.
Is there any way I can match numbers using a regex expression (exact number, without wildcards) ?
Thanks
=FILTER(A:A,REGEXMATCH(REGEXREPLACE(TO_TEXT(A:A),"-",""), "32323232323"))
to get both 323-23232-323 and 32323232323.
=FILTER(A:E,REGEXMATCH(TO_TEXT(B:B),"32323232323"))
to get number 32323232323.
Notes:
Converting to_text is a key here.
Change columns to yours.

Categories