PDA

View Full Version : Solved: If Statement



pico
11-23-2006, 07:57 AM
I have 7 cells that need to be checked for 3 types of values. For example if Cell 1-7 contain F or R output 1234
else if Cell 1-7 contain F and R output 2345
else if Cell 1-7 contain F/R output 2345

The 3 types of values are F, R and F/R. I'd like to be able to do this using excel formulas. But the if statement gives me errors. Is there a solution to this using excel formulas?...no vba please. Thanks

Shazam
11-23-2006, 09:41 AM
Can you post a sample file.

pico
11-23-2006, 10:02 AM
i have attached the file. There are 7 cells i need to check. If any of these cells contains a F/R it would automatically select 146829 as the part number. I have included the combinations. If one front or one rear is selected the part output is 146888. If bothe front and rear are selected the output is 146829.

Shazam
11-23-2006, 10:16 AM
I'm not sure I understand but this what I came up with. Can post a sample workbook with the expected results?

pico
11-23-2006, 11:04 AM
I have uploaded the file. Thank you for the help.

Shazam
11-23-2006, 11:45 AM
Maybe...


Input formula in cell J5:


=IF(AND(B3="F",D3="F",H3="F",J3="F",B5="F",D5="F",H5="F"),O4,IF(AND(B3="R",D3="R",H3="R",J3="R",B5="R",D5="R",H5="R"),O6,IF(OR(B3="F",D3="F",H3="F",J3="F",B5="F",D5="F",H5="F"),O5,IF(OR(B3="F",D3="F",H3="F",J3="F",B5="F",D5="F",H5="F"),O5,""))))


Hope it helps!

XLGibbs
11-24-2006, 12:30 PM
There are numerous more efficient ways perhaps. Using extended IF (OR statements is limited and on a larger scale could theoretically get slow.

I looked at the recent uploiad, but it is still not clear.

It seems you could be more clear in how the values get "selected" in cells 1 through 7. Is there going to be drop downs or data validation to determine "selection" of the values?

and where is the formula supposed to be located?

the attached file uses another option, assuming that your selection areas have no other information, you could use something like this...

IF(OR(COUNTIF(B3:J5,"F")=7,COUNTIF(B3:J5,"R")=7),146888,146829)

But I am assuming your sample is a small piece of a larger pie. There are many different, and easier ways to do things, it would be easier to provide a proper solution with a clear idea of what the final product needs to resemble or do.

pico
11-24-2006, 12:38 PM
I have got this part to work. Sorry I kept the thread open. I used nested If statement to solve the problem i had.