IF Formula

refpj2000

New Member
Joined
Jun 22, 2008
Messages
4
Excel 2007
Windows Vista
If number in cell A1= 1 and cell A2= 1,
if A1 is greater than A2, return, 3
if A1=A2 and is 1 or greater, return, 2
if A1=A2 and is less than, return, 1
if not return, 0
therefore value in a3 should be two
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
If Number in A1=2 A2= 1
therefore value in a3 should be 3
If Number in A1=0 A2= 0
therefore value in a3 should be 1
If Number in A1=1 A2= 2
therefore value in a3 should be 0

Using =if(ISBLANK(a1),0,IF(a1>a2,3,IF(a1,1,0)))
but can't workout how to add if A1=A2 and is 1 or greater, return, 2
Any help greatly appreciated.

Thanks

Pat
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hello Pat, welcome to MrExcel

Try this formula

=IF(COUNT(A1:A2)=2,IF(A1>A2,3,IF(A1=A2,IF(A1>=1,2,1))))+0
 
Upvote 0
Thanks Barry for your quick response.

Tried the formula result was 0, as opposed 2.

Many thanks again

Pat
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,462
Members
448,899
Latest member
maplemeadows

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