Multiple IF's in one cell

```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.

```
 0
mpmorin (28)
12/31/2008 4:10:24 PM
excel 39879 articles. 2 followers.

7 Replies
412 Views

Similar Articles

[PageSpeed] 11

```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
```
 0
12/31/2008 4:26: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@virgin.net> wrote in message
> 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

```
 0
mpmorin (28)
12/31/2008 4:45:05 PM
```On Dec 31 2008, 4:45=A0pm, "Michael Morin" <mpmo...@verizon.net> wrote:
>
> I have, for example, counties in one row and under them I have cities and
> towns in those counties. =A0So, really I have columns of info. You asked =
> rows. =A0Does it have to be in rows or can I use columns instead?
>
> "barry houdini" <barry.houd...@virgin.net> wrote in message
>
>
>
>
> > 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
>
> > =3DINDEX(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
>
> > =3DIF(COUNTIF(A2:J10,L2),INDEX(A\$1:J\$1,MIN(IF(A2:J10=3DL2,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- Hide quoted text -
>
> - Show quoted text -

Hello Michael,

Yes, I realised you had columns of data but what I wasn't sure of was
whether you just had a single row to search or multiple rows. It looks
like you have multiple rows so if you have counties in A1:J1 and towns/
cities below those in A2:J10 then you can use the second formula I
suggested, i.e.

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

which needs to be confirmed with CTRL+SHIFT+ENTER.

Ultimately it would probably be easier for you if you could change
your layout so that you had a single column of all towns/cities and
the adjacent column contained the relevant County, then you can jsut
do a simple VLOOKUP.
```
 0
1/1/2009 3:24:51 PM
```oh ok :)  Thank you!  I'll let you know how it turns out.

"barry houdini" <barry.houdini@virgin.net> wrote in message
On Dec 31 2008, 4:45 pm, "Michael Morin" <mpmo...@verizon.net> wrote:
>
> 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
> rows. Does it have to be in rows or can I use columns instead?
>
> "barry houdini" <barry.houd...@virgin.net> wrote in message
>
>
>
>
> > 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- Hide quoted text -
>
> - Show quoted text -

Hello Michael,

Yes, I realised you had columns of data but what I wasn't sure of was
whether you just had a single row to search or multiple rows. It looks
like you have multiple rows so if you have counties in A1:J1 and towns/
cities below those in A2:J10 then you can use the second formula I
suggested, i.e.

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

which needs to be confirmed with CTRL+SHIFT+ENTER.

Ultimately it would probably be easier for you if you could change
your layout so that you had a single column of all towns/cities and
the adjacent column contained the relevant County, then you can jsut
do a simple VLOOKUP.

```
 0
mpmorin (28)
1/1/2009 5:53:46 PM
```Well, it works WONDERFULLY!  The only thing is that I have to go back and
edit the range of the columns to find.  It keeps bumping them down by one
for proceding formulas.

"barry houdini" <barry.houdini@virgin.net> wrote in message
On Dec 31 2008, 4:45 pm, "Michael Morin" <mpmo...@verizon.net> wrote:
>
> 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
> rows. Does it have to be in rows or can I use columns instead?
>
> "barry houdini" <barry.houd...@virgin.net> wrote in message
>
>
>
>
> > 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- Hide quoted text -
>
> - Show quoted text -

Hello Michael,

Yes, I realised you had columns of data but what I wasn't sure of was
whether you just had a single row to search or multiple rows. It looks
like you have multiple rows so if you have counties in A1:J1 and towns/
cities below those in A2:J10 then you can use the second formula I
suggested, i.e.

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

which needs to be confirmed with CTRL+SHIFT+ENTER.

Ultimately it would probably be easier for you if you could change
your layout so that you had a single column of all towns/cities and
the adjacent column contained the relevant County, then you can jsut
do a simple VLOOKUP.

```
 0
mpmorin (28)
1/1/2009 6:33:57 PM
```On Jan 1, 6:33=A0pm, "Michael Morin" <mpmo...@verizon.net> wrote:
> The only thing is that I have to go back and
> edit the range of the columns to find. =A0It keeps bumping them down by o=
ne
> for proceding formulas.

OK, sorry, yes, you can fix the ranges with dollar signs so that only
the L2 reference will change as you drag down or across, i.e.

=3DIF(COUNTIF(\$A\$2:\$J\$10,L2),INDEX(\$A\$1:\$J\$1,MIN(IF(\$A\$2:\$J\$10=3DL2,COLUMN
(\$A\$2:\$J\$10)-
COLUMN(\$A\$2)+1))),"")
```
 0
1/1/2009 8:51:22 PM
```EXCELLENT ... You've made my job so much easier.  Now, I can streamline what
I did for next month's reports, I'll be all set!  Thank you again!

"barry houdini" <barry.houdini@virgin.net> wrote in message
On Jan 1, 6:33 pm, "Michael Morin" <mpmo...@verizon.net> wrote:
> The only thing is that I have to go back and
> edit the range of the columns to find. It keeps bumping them down by one
> for proceding formulas.

OK, sorry, yes, you can fix the ranges with dollar signs so that only
the L2 reference will change as you drag down or across, i.e.

=IF(COUNTIF(\$A\$2:\$J\$10,L2),INDEX(\$A\$1:\$J\$1,MIN(IF(\$A\$2:\$J\$10=L2,COLUMN
(\$A\$2:\$J\$10)-
COLUMN(\$A\$2)+1))),"")

```
 0
mpmorin (28)
1/2/2009 3:24:20 PM

Similar Artilces:

compute one of two missing value?
I want to create a table like this: column A is the name of the person column B is height in feet column C is height in meters How do I set it up so that if I enter a number in the feet column, excel would calculate and fill in the meter column, and if I fill in the meter column, excel would calculate and fill in the feet column? use a worksheet_change event if target.column=2 then target.offset(,1)=target*_____ if target.column=3 then target.offset(,-1)=target/_____ -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "james" <nospa...

I've got data copied into my spreadsheet that includes hyperlinks. Ther are thousands of these in a column. I can remove individually by right-clicking and selecting Hyperlink an Remove. I can then arrow down and do a control Y, cell by cell, What I want to do is highlight the column and be able tp remove th hyperlinks all at once. I've exhausted myself peering through knowlegebases and groups, bu cannot find any way to make this work. Thanks for any input you can provide -- Message posted from http://www.ExcelForum.com Hi one way: Use the following macro to remove hyperlinks...

Create a list with multiple criteria
I have a data base with 1,000's of addresses w/zipcodes (Sheet 1 columns A to E, E being zipcodes). After setting a base address I get all of the zipcodes within a given radius (in this case 70 zipcodes), listed in Sheet 2, Column A. Next, I use COUNTIF (in column B) to find how many addresses are in each zipcode, in this example there are 46 addresses within the 70 zipcodes. What I want to do is create a list in sheet three that will list each with the data from Sheet 1 columns A to E). Any help would be appreciated. Ronbo ...

Charting multiple multiples
Hopefully I can explain this in a way that will be understood. Data: Place A Place B Place C FWD Back FWD BACK FWD Back Org_1 1 2 3 2 1 3 Org_2 2 5 4 6 1 4 I would like to place the data so that FWD and Back data is stacked on top of each other in different colors, and placed in one row on a 3-D chart as Org-1 and a second row as Org_2. Any ideas? Thanks. If you arrange your data like this: Back FWD Org_1 Place A 2 1 Place B 2 3 Place C 3 1 Org_2 Place A 5 2 ...

Multiple Hyperlinks In Same Shape Doesn't Work
Can anyone tell me how I can get multiple hyperlinks in the same shape to work? I have no problem inserting the hyperlinks, but they all point to only one. I scoured these posts, and found this (http://groups.google.com/groups?q=hyperlink+group:microsoft.public.visio.*&hl=en&lr=&ie=UTF-8&oe=UTF-8&group=microsoft.public.visio.*&selm=3eea6467%241%40news.microsoft.com&rnum=2), which doesn't appear to work. Thanks in advance-- RAD Um, which version of Visio are you using? As far as I know, at least Visio 2002 and Visio 2003 support multiple hyperlinks. Can't...

Multiple Profiles, multiple accounts, multiple machine configuring?

distributing data into multiple cells
hii i have to prepare an exel sheet of some 2000 products..i have to copy d data from the net and then prepare the sheet,with 4 different columns for 4 diff types of entries..now when i copy data nad paste is as text.it all goes in a single cell in a row .how can i distribute the data l into multiple cells????????? -- jaspreet ------------------------------------------------------------------------ jaspreet's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=23821 View this thread: http://www.excelforum.com/showthread.php?threadid=374772 can you show some samp...

Single click selects multiple cells
When clicking on a single cell multiple cells are selected. The one time solution for this is to zoom in or out. This is problematic as 60% seems to be the zoom that works most of the time but at this zoom level the cell contents do not display. The time lost and the frustration that builds is killing my productivity and office attitude. Please give all of us a permanet fix. -- Thanks Mike ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" butt...

Is there a way to sort multiple columns with a tab or something?
I have a 4 column spreadsheet. I want to be able to click the heading for each of the columns to hav them sort by that column if clicked. How do I do that -- Message posted from http://www.ExcelForum.com Hi why not used the soprt icon for this. Note: This could screw up your sorting if Excel does not recognize your database columns correctly -- Regards Frank Kabel Frankfurt, Germany > I have a 4 column spreadsheet. > > I want to be able to click the heading for each of the columns to have > them sort by that column if clicked. How do I do that? > > > --- > Mess...

How do I send an email to multiple addresses having only the recipient see their own email address? Michelle wrote: > How do I send an email to multiple addresses having only > the recipient see their own email address? Put the addresses into the BCC: field. Note that many e-mail programs will decide such mails are spam though. >-----Original Message----- >How do I send an email to multiple addresses having only >the recipient see their own email address? >. Open your new email and go to tools, select recipient, when your address book opens select (highlight) the a...

Convert data into one WrapText cell
User's data is as follows: G Data......................... 4 no 5 20 more Data ............... etc where G through 20 is in a single row, and therefore Data occupies 3 rows. I believe this gives me a complete record where the Data occupies more than one row: Sub TestConvertToWrapText() Dim Cell As Range, StartRw As Long Dim EndRw As Long For Each Cell In ActiveSheet.Range("B2:B33") If Not IsEmpty(Cell) Then StartRw = Cell.Row If Not IsEmpty(Cell.Offset(1, 0)) Then EndRw = Cell.End(xlDown).Row...

Windows will not "Tile" when one of them has Money Plus open
I've discovered that I cannot get my windows to "Tile" when using Money Plus. This is a big bummer because that is how I update my 401k account (not on any exchange so I must do it manually) I copy/paste info into it (money) and it is so much easier if I can tile windows. I used to do it all the time with my older MM Deluxe 2004. Funny thing is that the Money window tiles but the other one acts just like when you click "Tile Windows" when there is only one open... "bupkiss" just a 'bleep' and back to fully maxed... any ideas? On Wed, 5 Sep 2...

INDEX-MATCH with cell text driven names
Hi, I've read through a few posts that are close to what I'm trying to do but i can't get it to work. I'm constructing a fantasy F1 spreadsheet while i'm bored off work sick. Sheetnames in workbook DriverSummary, AUS, MAL, CHN, BHR,.....for each round/country of the season. Each sheet race sheet has a column for car number in called AUSarray, MALarray etc. AUSREF is cell A1 on the race sheets My current formula in the diver summary works well and is shown below. I have N() to return 0 when a race hasn't happened yet so that my sum() works. =N(OFFSET(AUSREF;MATCH(\$A4;AUS...

Referencing the name of a worksheet in a cell
hello excel gurus... I would like to have a string of text that incorporates the name of on the worksheet tab. I have a series of worksheet that are all very similar, it is just one word in the title that changes and that is what I will be naming the worksheet. Is there a way that I can have that cell reference the tab name, so that I only have to name it once and not twice. Thanks! -Bob Bob, Not sure if you want to get the cell from the tab name, or set the tab name from the cell value. So, if the former =MID(CELL("filename",A1),FIND("]",CELL("filename&qu...

Exchange 2000 Distribution Lists
Hello We are running an Exchange 2000 environment in Exchange Native Mode and Windows Mixed Mode. We just converted from Exchange 5.5 Is there any way to configure multiple people to be owners or editors of the distribution lists? This was possible in 5.5, but we cannot find a means of accomplishing this in 2000 Any help would be appreciated Thank yo Jason "Jason P.S." <jason.pruden-shebaylo@investorsgroup.com> wrote: >We are running an Exchange 2000 environment in Exchange Native Mode and Windows Mixed Mode. We just converted from Exchange 5.5. > >Is there any w...

multiple selection
How can I select multiple records into a list box? I want that for append identical records (for select records) in another table. Many thanks Florin Use a subform instead of a list box. In a subform bound to a related table, you can append as many rows as applicable. It is possible (but not simple) to use an unbound multi-select list box that is populated in the Current event of the form, and executes Append, Delete, and Update query statements based on the ItemsSelected if they are changed. You will also have to find a way to respond to the user "undoing" changes. -- Al...

Need to have a dropdown list containing multiple rows
I am setting up an form and need to create a dropdown list that will contain 8 sets of data. Each set needs to contain 3 rows of data (name, street address & city/state/zip. The goal is to allow the user to click onto the cell, see the dropdown and select which address set to use. This would then place the data into three rows suitable for mailing. I have never attempted anything like this and am in need of assistance. Thank you. --- Message posted from http://www.ExcelForum.com/ Pat What you ask is easily done using Data Validation drop-down list and a few Vlookups but........Ex...

Multiple domains #6
Hi, Having done some research I have found that it is possible to send and receive email from multiple domains with Exchange 2003. I have a few questions that I would like cleared up if anyone can help. 1. Is it really as simple as configuring a recipient policy for the new domain and then changing the mail record for that domain to point to the proper IP address? 2. If I set up a new account in AD, and need this account to be associated with the second email domain, will the default SMTP email be for the first domain? If so, can I just edit this directly? 3. If I set the default SMTP add...

Combine multiple tables into one
I took over a database in which the last person created a new table for everyday worth of data (ie. Feb-21-08 is named 022108). There are over 100 tables in the single database with the same columns and table attributes, I would like to combine all of these tables into one where I have a Date_Key field in place of the table name. I figured out how to query the table names using the following: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left\$([Name],1)<>"~") AND (Left\$([Name],4) <> "Msys") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name; Now I j...

APPEND TO A CELL
How do I append to a number in A LARGE FILE column A only. EXAMPLE 1050 need 501050 In Publisher? -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "RUSSELL" <RUSSELL@discussions.microsoft.com> wrote in message news:B2DD30D7-7D95-4413-9050-4D164120EC0D@microsoft.com... > How do I append to a number in A LARGE FILE column A only. EXAMPLE 1050 > need > 501050 ...

forwarding mail to multiple external addresses
I have a user on our Exchange Server 2003 that wants his email to be forwarded to 2 different external email addresses and not have the original mail stored in his exchange mailbox at all. I can set this up to froward to only one external email address by creating a contact in Active Directory with an external email address and then forwarding to that contact. However, it won't allow me to forward to multiple contacts. Please help as this seems like a pretty common request from several users. I'm not sure, as I haven't tested it before, but you might be able to create a ...

Finding Data in multiple worksheets
Using Excel 2000, how can I find data in multiple worksheets; example: any number between 200 & 299 in 32 worksheets? If you mean you want to find a single number across 32 worksheets, group your worksheets (click on the first, ctrl-click on subsequent (or even shift-click)). Then Edit|Find But I think I'd use Jan Karel Pieterse's FlexFind: http://www.oaltd.co.uk/MVP/ If you meant you wanted to find all 100 numbers (200-299) in all 32 sheets, then I think I'd have a macro search for each number and report the results on a new worksheet. "mark@southwestconst.com&quo...

show multiple values that add to total in bar graph
Is there a way to show multiple values in a single bar (in a bar graph) that add up to a total (example: 127, 129, 87, 85, 60, 126, 89 add up to 703)? I want a sigle bar that goes to 703 but breaks the single bar down into these segments (preferrably by color showing the smaller segment amounts within the color. HELP!!!! Thanks! Hi, Is that not what the stacked column chart does? Cheers Andy Green Goose 89 wrote: > Is there a way to show multiple values in a single bar (in a bar graph) that > add up to a total (example: 127, 129, 87, 85, 60, 126, 89 add up to 703)? I > want...

Passing avalue from one form to another
I have a form (ItemBrowse_frm) that provides me a list of active Item numbers. When I click the Item number I want to pass the Item number to my other form (SingleBill_frm) and requery the form based on that part number. I am using the following OnClick Forms![SingleBill_frm]![ParentItembx].Value = Forms!ItemBrowse_frm.[ItemNumber] Forms![SingleBill_frm].Requery Somehow the SingleBill_frm does not requery and the field that I am passing the value to does not show the value passed until I highlight the field. Is there a better way to do this or what am I doing wrong? Thank you! ...

Removing Menu Option in VBA ( grey one out ) ?
Tracking Changes ? I am after the workaround for the disabling of tracking changes b anyone other than me. I presume ( and yes since I learnt this method I love it ) I can us the Environment settings... -------------------------------------------------------------------------------- quote: -------------------------------------------------------------------------------- Sub MeOnlyTrackChanges() If Environ("Fullname") <> "My Name Here" then Exit sub Elseif: <grey out the menu option for track changes here VBA COD needed > End Sub -----------------------...