# Nested IF formula not working

I am trying to write a nested IF formula in Google Sheets.

=IF(F5=1,"10", IF(F5=2, "15", IF(F5=3, "35", IF(F5=4, "60", IF(F5=5, "120", "Missing score")))))


The idea is that in column F, I have scores from 1 to 5, and in another column I would like to have the time approximation for processing an item with that score. Items scored 1 take 10 mins to process, scored 2 take 15 mins, scored 3 take 35, etc.

However, I am getting an error.

Even if I write simple if formula - e.g. =if(G5>1, "true", "false") I get an error.

What am I doing wrong?

My spreadsheet Locale was set to one that uses the comma as decimal separator. For example, 1/2 is displayed as 0,5 instead of 0.5.

Because of that, the comma , isn't used in those Locales to separate arguments in formulas, and the semicolon ; is used instead.

The formula worked once I made the substitution:

=IF(F5=1; "10"; IF(F5=2; "15"; IF(F5=3; "35"; IF(F5=4; "60"; IF(F5=5; "120"; "Missing score")))))


Also, putting quotation marks "" around my numbers made them text strings, so to return numbers they should not be added:

=IF(F5=1; 10; IF(F5=2; 15; IF(F5=3; 35; IF(F5=4; 60; IF(F5=5; 120; "Missing score")))))

• Also, in that same locale, you would use the backslash as a column separator in arrays. For example a 2x2 array {A1 \ B1; A2 \ B2} Commented Jul 12 at 22:09

For your use case, the CHOOSE function would be easier to manage:

=IFERROR(CHOOSE(F5, 10, 15, 35, 60, 120), "Invalid/Missing")


If Locale uses comma as decimal separator:

=IFERROR(CHOOSE(F5; 10; 15; 35; 60; 120); "Invalid/Missing")