Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mea mea is offline
external usenet poster
 
Posts: 8
Default If statement only shows value in first cell

I'm trying to use an IF statement to find a value in a row array, and return
that text value in the formula cell.

1 a b c d e
2 101 INDUSTRIES brass
3 LIGHTING HOME nickel
4 FRANKFURT brass nickel stainless copper
5 Jersey copper
6 Dallas nickel stainless cooper brass


{=IF(b2:e2="brass,"brass",0)}
next cell down would have {=IF(b3:e31="brass,"brass",0)}

If "brass" is in the first cell of the array, it returns "brass". If it in
in cells c2,d2,or e2, it returns a 0. What am I doing wrong?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default If statement only shows value in first cell

If you have a group of cells and want to know if some text is in ANY of them,
use COUNTIF:

=IF(COUNTIF(B2:E2,"Brass")0,"Brass",0)
--
Gary''s Student - gsnu200812


"Mea" wrote:

I'm trying to use an IF statement to find a value in a row array, and return
that text value in the formula cell.

1 a b c d e
2 101 INDUSTRIES brass
3 LIGHTING HOME nickel
4 FRANKFURT brass nickel stainless copper
5 Jersey copper
6 Dallas nickel stainless cooper brass


{=IF(b2:e2="brass,"brass",0)}
next cell down would have {=IF(b3:e31="brass,"brass",0)}

If "brass" is in the first cell of the array, it returns "brass". If it in
in cells c2,d2,or e2, it returns a 0. What am I doing wrong?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default If statement only shows value in first cell

Hi,

You can use this short version:

=IF(COUNTIF(B3:E3,"brass"),"brass",)

--
Thanks,
Shane Devenshire


"Mea" wrote:

I'm trying to use an IF statement to find a value in a row array, and return
that text value in the formula cell.

1 a b c d e
2 101 INDUSTRIES brass
3 LIGHTING HOME nickel
4 FRANKFURT brass nickel stainless copper
5 Jersey copper
6 Dallas nickel stainless cooper brass


{=IF(b2:e2="brass,"brass",0)}
next cell down would have {=IF(b3:e31="brass,"brass",0)}

If "brass" is in the first cell of the array, it returns "brass". If it in
in cells c2,d2,or e2, it returns a 0. What am I doing wrong?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default If statement only shows value in first cell

Hi,

You may also try this array formula

=if(or((a3:b3="brass"),"brass",""))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Mea" wrote in message
...
I'm trying to use an IF statement to find a value in a row array, and
return
that text value in the formula cell.

1 a b c d e
2 101 INDUSTRIES brass
3 LIGHTING HOME nickel
4 FRANKFURT brass nickel stainless copper
5 Jersey copper
6 Dallas nickel stainless cooper brass


{=IF(b2:e2="brass,"brass",0)}
next cell down would have {=IF(b3:e31="brass,"brass",0)}

If "brass" is in the first cell of the array, it returns "brass". If it in
in cells c2,d2,or e2, it returns a 0. What am I doing wrong?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cant change the cell format it shows too many different cell form not able to make changes in sheet Excel Worksheet Functions 0 January 9th 07 04:16 AM
format a cell with a formula so an empty reference cell shows blan M2 Excel Discussion (Misc queries) 3 November 7th 06 10:42 PM
Cell only shows link in text, not contents of reference cell Jay Mac New Users to Excel 4 August 23rd 05 08:36 PM
cell shows 20. Formula shows 20. why not 540/27 griswold Excel Worksheet Functions 2 August 12th 05 05:56 PM
Custom format that shows blank cell if another cell is empty Zdenek Moravec Excel Discussion (Misc queries) 1 March 25th 05 11:45 AM


All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"