If Statement/Excel 2007

knaimi

New Member
Joined
Jun 23, 2013
Messages
47
I have created three columns (A, B, & C) in Excel 2007 that contain number values. I’m trying to create one “If Statement” in column D that does the following:</SPAN>

  1. If the value of the number in column C is less than both or any of the other two numbers then type 1
  2. If the value of the number in column C equals the value of both numbers Or if it equals one but greater than the other then type 0
  3. If the value of the number in column C is greater than the value of both numbers then type -1
</SPAN>
Example: </SPAN>
A</SPAN>
B</SPAN>
C</SPAN>
D (If Statement)</SPAN>
3</SPAN>
4</SPAN>
3</SPAN>
1</SPAN>
4</SPAN>
2</SPAN>
4</SPAN>
0</SPAN>
6</SPAN>
7</SPAN>
8</SPAN>
-1</SPAN>

<TBODY>
</TBODY>

Thank you,</SPAN>
 
I just cannot get the code into the forum :( :(

i will send in a PM

Excel Workbook
G
6-1
Sheet1
 
Last edited:
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
=IF(OR(AND($C1<$A1,$C1<$B1),$C1<$A1,$C1<$B1),1,IF(OR(AND($C1=$A1,$C1=$B1),AND($C1=$A1,$C1>$B1),AND($C1=$B1,$C1>$A1)),0,IF(OR(AND($C1>$A1,$C1>$B1)),-1,"Didn't many any criteria")))

adjusted formula
 
Upvote 0
here are my results..

A B C D
3431
4240
678-1
6721
10831
10561
10521
578-1
5761
5550
5350
5651

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,221,553
Messages
6,160,468
Members
451,649
Latest member
fahad_ibnfurjan

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