MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2004, 05:43 PM   #1
jprior
 
Join Date: Jan 2004
Posts: 9
Default What am I missing?

I want cell K2 to display the number in C2 if C2 matches any of the numbers in C24 through H24, otherwise leave K2 blank.
Am I close?

{=IF(AND(C24:H24=C2),C2," ")}

thanks
jprior is offline   Reply With Quote
Old Mar 30th, 2004, 05:46 PM   #2
bolo
 
Join Date: Mar 2002
Posts: 292
Default Re: What am I missing?

you are close,

you do not need the and

{=IF(C24:H24=C2,C2," ")}

array entered of course

HTH
bolo is offline   Reply With Quote
Old Mar 30th, 2004, 06:00 PM   #3
rrdonutz
 
Join Date: Jan 2003
Location: Round Rock, Texas
Posts: 564
Default Re: What am I missing?

=IF(COUNTIF(C24:H24,C2),C2,"")
rrdonutz is offline   Reply With Quote
Old Mar 30th, 2004, 06:09 PM   #4
jprior
 
Join Date: Jan 2004
Posts: 9
Default Re: What am I missing?

Thanks... the COUNTIF version works!
jprior is offline   Reply With Quote
Old Mar 30th, 2004, 07:04 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 39,503
Default Re: What am I missing?

A bit faster...

=IF(ISNUMBER(MATCH(C2,C24:H24,0)),C2,"")

If C2 houses a number...

=ISNUMBER(MATCH(C2,C24:H24,0))*C2
Aladin Akyurek is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 01:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.