Group:  Microsoft Excel ยป microsoft.public.excel
Thread: Multiple IF's in one cell

Geek News

Multiple IF's in one cell
"Michael Morin" <mpmorin[ at ]verizon.net> 12/31/2008 4:10:24 PM
I would like to find a formula that will allow me to sort/find a name in
several columns of names and if it is one of the columns then indicate which
column heading it was under. I've tried embedded IFs but I have limited
experience with using multiple formulas in one cell.

Re: Multiple IF's in one cell
barry houdini <barry.houdini[ at ]virgin.net> 12/31/2008 4:26:05 PM
Hello Michael,

Are you searching for the name in a single row or several rows?

If it's the former then assuming you want to search in A2:J2 and
return the heder from A1:J1 try

=INDEX(A$1:J$1,MATCH(L2,A2:J2,0))

where L2 contains the name for which you need to search

for the latter try this to search within rows 2 to 10

=IF(COUNTIF(A2:J10,L2),INDEX(A$1:J$1,MIN(IF(A2:J10=L2,COLUMN(A2:J10)-
COLUMN(A2)+1))),"")

This second formula is an "array formula" which needs to be confirmed
with CTRL+SHIFT+ENTER so that curly braces appear around the formula
in the formula bar
Re: Multiple IF's in one cell
"Michael Morin" <mpmorin[ at ]verizon.net> 12/31/2008 4:45:05 PM
Thanks for your help.

I have, for example, counties in one row and under them I have cities and
towns in those counties. So, really I have columns of info. You asked about
rows. Does it have to be in rows or can I use columns instead?

"barry houdini" <barry.houdini[ at ]virgin.net> wrote in message
news:63fe3cba-1778-477b-b217-2576b881608d[ at ]w1g2000prk.googlegroups.com...
[Quoted Text]
> Hello Michael,
>
> Are you searching for the name in a single row or several rows?
>
> If it's the former then assuming you want to search in A2:J2 and
> return the heder from A1:J1 try
>
> =INDEX(A$1:J$1,MATCH(L2,A2:J2,0))
>
> where L2 contains the name for which you need to search
>
> for the latter try this to search within rows 2 to 10
>
> =IF(COUNTIF(A2:J10,L2),INDEX(A$1:J$1,MIN(IF(A2:J10=L2,COLUMN(A2:J10)-
> COLUMN(A2)+1))),"")
>
> This second formula is an "array formula" which needs to be confirmed
> with CTRL+SHIFT+ENTER so that curly braces appear around the formula
> in the formula bar

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net