SOLVED

New Contributor

# Need a formula

Hi all.

I'm having troubles entering a if/or statement.

Basically, I'm trying to have a function for cell B2 "if A1 shows "\$60", then display \$500, or if A1 is \$120, then display "\$1,000". If neither, display "\$0" "

Everything I try is showing as entered incorrectly.
5 Replies

# Re: Need a formula

=IF(A1="\$60","\$500",IF(A1="\$120","\$1000","\$0"))

Is this what you are looking for? I understand that you want to enter "\$60" or "\$120" in A1, not "60" or "120".

# Re: Need a formula

Your formula is giving me "0" no matter if I type 60 or 120.

Basically, in A1, I have our pet rent, which is either one or two pets. \$60 per pet, max 2 pets.

In B2, am inputting our pet fee, 500 for 1 pet, \$1000 for 2.

I appreciate the help.
best response confirmed by Sergei Baklan (MVP)
Solution

# Re: Need a formula

=IF(A1=60,500,IF(A1=120,1000,0))

Enter above formula in B2 and it returns 500 when 60 is entered in A1 or it returns 1000 when 120 is entered in A1 (or it returns 0 if neither 60 nor 120 is in A1).

# Re: Need a formula

BAM! Got it! Thank you so much!

# Re: Need a formula

As variant

``=500*SUM( ( {60;120}=A1)*{1;2} )``