If Statement/Excel 2007

knaimi

New Member
Joined
Jun 23, 2013
Messages
49
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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
=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
[TABLE="width: 348"]
<tbody>[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]-1[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]-1[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]1[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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