Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I use IF to generate values

HI,


i'm a massive newbie to using spreadsheets and set myself a task to learn a thing or two.


Using Numbers, I want to create a football league formula whereby I submit the score in two different cells and I can then generate a W/L/D value in a third cell. I'm sure this is embarrassingly easy...


Also, I want to reference a value in a cell in a different sheet, but none if the formulas I looked at seem to work - any ideas?!


im using the beta version, if that makes any difference?!


thanks!

MacBook Pro, Mac OS X (10.5.8)

Posted on Aug 6, 2014 3:38 PM

Reply
8 replies

Aug 6, 2014 6:02 PM in response to ryanbrown_6

Ryan,


These are basic spreadsheet operations which you will find simple as you come to know them better.


Let's say that team A's score is in Column A and team B's score is in column B. In column C, you could write an expression that gives you the W/L/D result from team A's perspective if you write:


=IF(A>B, "W", IF(B>A, "L", "D"))


In English: IF A's score is greater than B's, then the result is "W", else IF B's score is greater than A's, then the result is "L", else the result is "D".


To reference a cell in another Sheet, you just need to include the Sheet name in the cell reference, followed by a double colon. For instance, a reference to cell A1 in sheet Fred would be written: =Fred::A1.


Regards,


Jerry

Aug 6, 2014 6:06 PM in response to ryanbrown_6

Hi ryan,


here is one approach:

User uploaded file

The formula in D2=IF(C2>C3,"win",IF(C2<C3,"loss","draw")

D3=IF(D2="draw",D2,IF(D2="win","loss","win"))

Select both D2 and D3, grab the yellow dot and drag down to fill.

User uploaded file

Here is your stats table.

B2=COUNTIFS(Table 1::$B,$A2,Table 1::$D,"=win")

I dragged this across and then modified the formula in the losses and draws columns ("=loss" in losses, etc..)

The way I constructed this formula will answer your question about referencing cells in other tables but we will reference columns.

COUNTIFS will take a series of test values and conditions separated by commas.

our first test values are column B in Table 1- click the column head. condition is that it equal A2- click there.

type a comma

next test values are Table 1::column D-click there.

condition is "=win"

When we drag this formula across we don't want the columns changing so make sure the reference is set to preserve column.

Once you have adjusted the losses and draws you can select all three and fill down.


quinn

Aug 7, 2014 6:05 AM in response to t quinn

Thank you to you both - really helpful and I've solved the WLD issue. Is there anything I can add so that it doesn't carry out the action until there is content within the cell? Ie. for un played fixtures I currently have a lot of D's.


Jerry, I'm still struggling with the referencing. I am sure I'm doing something stupid, but have attached a screenshot.


User uploaded file


Quinn - I'm clearly not the first person to create a sports spreadsheet 😉! Yours seems far more organised than mine though!

How do I use IF to generate values

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.