IF.., AND.., OR.., Statement

roughleg

Board Regular
Joined
Jun 21, 2004
Messages
181
Two copies of my first post came up and I deleted one by now both are gone, so here it goes again.
I need to return the values in different ranges based on the results of the following match. If the result is between 1 and 3 then return Z1, if the result is between 4 and 9 then return X1, if the result is greater than 10 then return Y1. If tried several if statements and I can't seem to make them work.
=INDEX($A$2:$K$275,MATCH($W$1,$A$2:$A$275,0),10)
Thanks,
Skip
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
try this
Code:
=IF(AND(A1>0,A1<4),Z1,IF(AND(A1>3,A1<10),X1,IF(Y1>9,Y1,"not")))
 

roughleg

Board Regular
Joined
Jun 21, 2004
Messages
181
Well, I was trying to do it all in one statement, but I can see how I can get what with you example.
Thanks,
Skip
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Assuming your result in A1, perhaps:

=INDEX(X1:Z1,,LOOKUP(A1,{1,3;4,1;10,2}))
 

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
Two copies of my first post came up and I deleted one by now both are gone, so here it goes again.
That was me, sorry about that. I locked and deleted one, and apparently you deleted the other one in the meantime. But I couldn't remember the username of who had posted it to let them (you) know about the mixup. :oops:
 

Forum statistics

Threads
1,141,667
Messages
5,707,723
Members
421,525
Latest member
carian1980

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
Top