![]() |
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"))))))) |
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"))))))) |
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"))))))) |
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"))))))) |
All times are GMT +1. The time now is 03:32 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com