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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
=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,551
Messages
6,160,460
Members
451,648
Latest member
SuziMacca

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