davvs
davvs

Reputation: 1059

How to make IF statements in google spreadsheets

I' like to make a cell show just the letter "A" if A2 > B2 or "B" if that's not the case.

However I get #ERROR in the resulting cell when I try to type: =IF(A2>B2,"A","B")

same error if I try =IF(GT(A2,B2),"A","B")

I've made a document to demonstrate this https://docs.google.com/spreadsheets/d/1KO4V6eqRVnrKgN0ViDBD_etd3WX4CoGZ308MIGO359s/edit?usp=sharing

Upvotes: 0

Views: 47

Answers (2)

Max Makhrov
Max Makhrov

Reputation: 18707

try:

=IF(A2>B2; "A"; "B")

in some regions comma is used, so formula =IF(A2>B2,"A","B") works fine if you go to file > settings and change regional settings to "US"

Upvotes: 1

Sayed zishan ali
Sayed zishan ali

Reputation: 41

Just simply copy this =IF(A2>B2,"A","B") into your cell without any space. i found some blank spaces in your code

Upvotes: 1

Related Questions