Solved

If then else rules in excel

Posted on 2013-10-22
3
142 Views
Last Modified: 2014-01-31
Hi all -

I need to create a rule which I could then copy and apply to all cells in a table.

If        C8 = 'S'
and     C9 = 'A'
and     S8 = 1
and     S9 = 2

then concat =C9 + ' ' + "\" + ...

ELSE

If If        C8 = 'S'
and     C9 = 'S'
and     S8 = 1
and     S9 = 1

THEN CONCAT= C9 + C10 + ' ' + "\" + ...
0
Comment
Question by:hwassinger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 39591464
That should be something like this:

=IF( AND( C8="S", C9="A", S8=1, S9=2 ), C9+"\"+... ,
   IF( AND( C8="S", C9="S", S8=1, S9=1 ), C9+C10+"\"+... , ??? ) )
0
 
LVL 22

Expert Comment

by:mcsween
ID: 39591487
Excel IF function is If Else by default.  Syntax is

=IF(Test,truestatement,falsestatement)

If you need to test for more than one thing you need to use the AND function.  The following code tests to see if A1, B1, C1, and D1 = 1.  If true it sums them, otherwise it CONCATENATES the words "It's" and "False"  True should return the number 4, false will write the text "It's False"
=IF(AND(A1=1,B1=1,C1=1,D1=1),SUM(A1:D1),CONCATENATE("It's ","False"))

Open in new window

0
 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
ID: 39591798
=IF( AND( C8="S", C9="A", S8=1, S9=2 ), C9&"\"&... ,
   IF( AND( C8="S", C9="S", S8=1, S9=1 ), C9&C10&"\"&... , "Neither test was matched" ) )

Open in new window

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question