Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

excel nested if statements

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Excel Nested If statements

Excel Nested If statements

ResolvedVersion 2003

Stacy has attended:
Excel Advanced course
Access Intermediate course
Access Advanced course

Excel Nested If statements

When entering a Nested IF statement, if you want 3 Ifs, what do you enter in the 'false' field? And how do you use the Name Box and is this important?

RE: Excel Nested If statements

Hello Stacy

Thank you for your question and welcome to the forum.

There always needs to be something in the value_if_false part of the IF function in order for it to work.

It depends how many options you want Excel to choose from as to how many IF functions you use - for example, if you use 3 IF statements, this would indicate that there are 4 possible outcomes Excel can enter in as your result. The last or fourth outcome would be entered into the value_if_false part of the function as this is the only possible outcome/option left after Excel has exhausted the first three.

The Name box is used to apply a name to a cell or cell range. It can be used to either (a) navigate to this particular cell or cell range; or (b) the name can be used in a formula in place of a cell reference or references, e.g. if you named the range A2:A4 as January, then you could have a formula in cell A5 that states =SUM(January) and it would be the same as putting in =SUM(A2:A4).

I hope this is helpful.

Kind regards
Amanda

RE: Excel Nested If statements

I cannot figure out what to put in the 'false' field so that I can get to my next If statement. I tried putting =if but that just gave me a response of =if.

RE: Excel Nested If statements

Hello Stacy

If you let me know what the formula needs to do, then I can provide further assistance if I'm able. If it would help to email a spreadsheet through to me, please email to amanda@stl-training.co.uk with an explanation of what the IF statement needs to do.

thanks
Amanda

RE: Excel Nested If statements

Due to confidentiality reasons I can't send through the spreadsheet but basically I have a column J which has a count of either 0, 1, 2, or 3. In column Q I want it to say Red if it is 3, Amber for 1 or 2 and Green if 0. Ia slo wanted to do this for column K to be expressed in column R.

RE: Excel Nested If statements

Hi Stacy

I think your formula would need to go as follows (in column Q - ? represents the number in the cell reference):

=IF(J?=3,"Red",IF(OR(J?=2,J?=1),"Amber","Green"))

Basically this is saying if there is a number 3 in the cell, enter the word Red. If there is a number 2 or 1 in the cell, enter the word Amber. The only other option is to enter the word Green assuming you only have the numbers 3, 2, 1 or 0 in column J.

Formula in column R would be the same except replacing references to column J with references to cells in column K.

Let me know how you get on.

Amanda

RE: Excel Nested If statements

Thank you Amanda that worked...it also taught me that I should sign up for a VB course!

Excel tip:

Colouring cells containing formulas

Cells in a worksheet can contain values or they can contain formulas. You may wish to identify all the cells in your worksheet that contain formulas by colouring those cells.

Follow these steps:
1. Choose Edit > Go To menu, or press either F5 or Ctrl+G. Excel displays the Go To dialog box.
2. Click Special. Excel displays the Go To Special dialog box.
3. Select the Formulas radio button option.
4. Select OK.

At this point, every formula cell in the worksheet is selected, and those cells can be coloured formatted as desired.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.