0

So I have this formula:

=CONCAT(=IF(F26 = " Kb","0",IF(F26 = "16 Kb","16",IF(F26 = "64 Kb","64"))))

I'm trying to return the result "0" or "16" or "64". Three possible inputs, and three outputs. This function currently returns a error, what am I doing wrong?

The support page listing the possible functions

2 Answers 2

2

The = before the IF() is the first problem. The = is only needed at the beginning of the formula, not when nesting functions.

Remove the Concat() from the formula. It does not look like you want to concatenate anything, since the IF() is the only argument and your desired outcome is just a number.

The last nested IF does not have a "false" parameter. If F26 contains any other text, the formula will return "FALSE", so you may want to control that, too.

All suggestions rolled into this:

=IF(F26 = " Kb","0",IF(F26 = "16 Kb","16",IF(F26 = "64 Kb","64","other")))
0

The main problem with your current function lies in the extra = and the unnecessary use of concat. If you're interested in a simplified method you can try this:

You can parse it by just extracting the digits using regexextract:

=IFERROR(REGEXEXTRACT(A1,"\d+"),0)

to explain - the inner function regexextract is basically specifying to only extract the digits using \d+ the \d means any digit and the + is to allow one or more than one digit to match. This would effectively exclude the kb in your text.

When a regex doesnt match, meaning there was no digit in the cell, it returns as #N/A so you can default it to return 0 instead by wrapping your function in IFERROR

sample sheet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.