Help with IF Statement

edam4i

New Member
Joined
Jul 28, 2018
Messages
11
How do I get to check two cells if they match and then return a value?

I'm using an Id Statement but it's working for 2 out of 3 scenarios.

=IF(A1=B1,1,0)

A1 B1 C1
HAM HAM 0
BEEF BEEF 1
TURKEY TURKEY 1

The If Statement works on BEEF=BEEF and TURKEY=TURKEY but not HAM=HAM?

Please help!
Colin
 
Not that this will solve your problem, but if you are actually entering only 1, 2, or 3 you could use:

=CHOOSE(A1+1,"","Ham","Turkey","Beef")


and the IF statement can deal with numbers or letters, so I'm still not getting a sense of your problem

What do you mean by this:

When I input words instead of numbers and match everything works fine but I need to use a mixture so maybe the IF Statement isn't suitable?
any suggestions?

Can you explain?

Make sure if you are entering a number in a formula do not put it in quotes i.e. "1" unless you want it to be text
 
Last edited:
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Of course using your example this should be:

=CHOOSE(A1+1,"","Ham","Beef","Turkey")
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,127,997
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top