Solved

If then else rules in excel

Posted on 2013-10-22
3
100 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
  • 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 21

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now