ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If statement only shows value in first cell (https://www.excelbanter.com/excel-worksheet-functions/209766-if-statement-only-shows-value-first-cell.html)

mea

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?



Gary''s Student

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?



ShaneDevenshire

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?



Ashish Mathur[_2_]

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?




All times are GMT +1. The time now is 02:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com