Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Nested if statement

In the following example column E thru K, are labelled Machine1 thru
Machine6 respectively, in only 1 of the columns I mark with an "X",
this lets me know that the information I enter in other columns on the
same row are linked to that specific machine

For example, I place an "X" in E3, all the data in columns
L,M,N,O,P......... and so on belong to Machine1. If I were to place an
"X" in F4 then the data belongs to Machine2.

In column E thru K only one "X" exists on each row

Now I'm trying to look at columns E thru K and if an "X" exists on that
row then place the text, Machine1, Machine2 etc. etc. in a cell in
column B. The if statement below, does not seem to work correctly, when
the formula is copied down several rows, the Machine # does not change
to reflect what is in column E thru K. The one good thing is it has no
more than 7 nested if's. Any suggestions or easier ways of doing this.


=IF(E3="X","Machine1",IF(F3="X","Machine2",IF(G3=" X","Machine3",IF(H3="X","Machine4",IF(I3="X","Mach ine5,IF(J3="X",Machine6",IF(K3="X","Machine7","No
Machine")))))))

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Nested if statement

Here's one way:

=IF(COUNTIF(E3:K3,"x"),"Machine"&MATCH("x",E3:K3,0 ),"")

Biff

"burl_h" wrote in message
ups.com...
In the following example column E thru K, are labelled Machine1 thru
Machine6 respectively, in only 1 of the columns I mark with an "X",
this lets me know that the information I enter in other columns on the
same row are linked to that specific machine

For example, I place an "X" in E3, all the data in columns
L,M,N,O,P......... and so on belong to Machine1. If I were to place an
"X" in F4 then the data belongs to Machine2.

In column E thru K only one "X" exists on each row

Now I'm trying to look at columns E thru K and if an "X" exists on that
row then place the text, Machine1, Machine2 etc. etc. in a cell in
column B. The if statement below, does not seem to work correctly, when
the formula is copied down several rows, the Machine # does not change
to reflect what is in column E thru K. The one good thing is it has no
more than 7 nested if's. Any suggestions or easier ways of doing this.


=IF(E3="X","Machine1",IF(F3="X","Machine2",IF(G3=" X","Machine3",IF(H3="X","Machine4",IF(I3="X","Mach ine5,IF(J3="X",Machine6",IF(K3="X","Machine7","No
Machine")))))))



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Nested if statement

Biff,

Thanks for the help, your solution worked great

burl

T. Valko wrote:
Here's one way:

=IF(COUNTIF(E3:K3,"x"),"Machine"&MATCH("x",E3:K3,0 ),"")

Biff

"burl_h" wrote in message
ups.com...
In the following example column E thru K, are labelled Machine1 thru
Machine6 respectively, in only 1 of the columns I mark with an "X",
this lets me know that the information I enter in other columns on the
same row are linked to that specific machine

For example, I place an "X" in E3, all the data in columns
L,M,N,O,P......... and so on belong to Machine1. If I were to place an
"X" in F4 then the data belongs to Machine2.

In column E thru K only one "X" exists on each row

Now I'm trying to look at columns E thru K and if an "X" exists on that
row then place the text, Machine1, Machine2 etc. etc. in a cell in
column B. The if statement below, does not seem to work correctly, when
the formula is copied down several rows, the Machine # does not change
to reflect what is in column E thru K. The one good thing is it has no
more than 7 nested if's. Any suggestions or easier ways of doing this.


=IF(E3="X","Machine1",IF(F3="X","Machine2",IF(G3=" X","Machine3",IF(H3="X","Machine4",IF(I3="X","Mach ine5,IF(J3="X",Machine6",IF(K3="X","Machine7","No
Machine")))))))


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Nested if statement

You're welcome. Thanks for the feedback!

Biff

"burl_h" wrote in message
oups.com...
Biff,

Thanks for the help, your solution worked great

burl

T. Valko wrote:
Here's one way:

=IF(COUNTIF(E3:K3,"x"),"Machine"&MATCH("x",E3:K3,0 ),"")

Biff

"burl_h" wrote in message
ups.com...
In the following example column E thru K, are labelled Machine1 thru
Machine6 respectively, in only 1 of the columns I mark with an "X",
this lets me know that the information I enter in other columns on the
same row are linked to that specific machine

For example, I place an "X" in E3, all the data in columns
L,M,N,O,P......... and so on belong to Machine1. If I were to place an
"X" in F4 then the data belongs to Machine2.

In column E thru K only one "X" exists on each row

Now I'm trying to look at columns E thru K and if an "X" exists on that
row then place the text, Machine1, Machine2 etc. etc. in a cell in
column B. The if statement below, does not seem to work correctly, when
the formula is copied down several rows, the Machine # does not change
to reflect what is in column E thru K. The one good thing is it has no
more than 7 nested if's. Any suggestions or easier ways of doing this.


=IF(E3="X","Machine1",IF(F3="X","Machine2",IF(G3=" X","Machine3",IF(H3="X","Machine4",IF(I3="X","Mach ine5,IF(J3="X",Machine6",IF(K3="X","Machine7","No
Machine")))))))




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
Nested "IF" Statement lajohn63 Excel Worksheet Functions 1 October 6th 06 10:56 AM
Nested IF statement with VLOOKUP James Hamilton Excel Discussion (Misc queries) 1 August 16th 06 07:46 AM
:confused: Nested if then else statement polk383 Excel Worksheet Functions 4 May 28th 06 06:02 PM
Nested IF Statement Question EleKtriKaz Excel Discussion (Misc queries) 6 April 5th 06 06:21 AM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM


All times are GMT +1. The time now is 02:35 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"