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

logical functions

ResolvedVersion 2019

Logical functions

In C3 I want to show Won or Lost. I have data in columns Q3 to T3 with values . I want to set up in Col V3 a cell to tell me:-
If Col C says Lost - show 0 if Col C shows Won - show the sum of Q3:T3.

It feels like this should be simple but I can't get it to work. Whatever I do I get a return of 0.
I have set up defined names of Lost and Won ( not sure if that was necessary)
I have tried this as an =IF which seemed the correct option.

Please advise where I am going wrong.
Thank you

RE: Logical functions

Hi Janet,

Thank you for your question. You're right, Excel can be very particular in what it wants from us for the correct outcome. For your data, the following IF statement works for me:

=IF(C3="Lost",0,SUM(Q3:T3))

To test for text, use = and ""
It's not case sensitive but spelling and spaces matter.
Also, when you "nest" a second function inside IF, make sure you put the opening and closing brackets in the right places.
Note that "Won" is implied in the Value if False.

If cell C3 (Won, Lost) is empty, you might want to write a nested IF statement to tell you it’s empty, otherwise Excel will simply return the Value if False:

=IF(C3="Lost",0,IF(C3=”Won”,SUM(Q3:T3),”Empty”))

I hope this helps.

Kind regards
Marius Barnard
STL


RE: Logical functions

Thank you Marius, all working perfectly now.

RE: Logical functions

Great, glad I could help!

Kind regards
Marius

Excel tip:

Use the SUBTOTAL function in Excel

You can create subtotals in your spreadsheet using the SUBTOTAL function, which looks like this:

=SUBTOTAL(9,cell:cell)

9 represents the function being used (SUM), followed by the range of cells the function is operating on.

The neat thing about using the Subtotal function is that if you have used it several times in the same column or row, clicking on the AutoSum button at the end of the column or row will make Excel add only the results of cells containing the Subtotal function in that column or row.

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.