![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: NY, NY
Posts: 31
|
I'd like to create a formula that results in a specific value if data in a cell is equal to an item in a list. I think this is an array formula but can't get it to work.
Here's what I've got so far: =IF(A1=$C$6:$C$8,1.295,1.1) where C6:C8 is the list. I seem only to get 1.295 if A1 is equal to C6. Thanks! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Hiya,
How about a non-array formula? =if(countif($C$6:$C$8,A1),1.295,1.1) Adam |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
oops..typo
=if(Countif($C$6:$C$8,A2)>0,1.295,1.1) my bad Adam |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
I didn't see any typo, but now you've got "one". Aladin |
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Location: NY, NY
Posts: 31
|
THANKS! And quick too!
|
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
=IF(SUM((A1=$C6:$C$8)+0),1.295,1.1) ... with CTRL+SHIFT+ENTER will give you the right result 1.295
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
Note: This is an array formula which must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|