Date: 12/05/2015 22:21:03
From: party_pants
ID: 721751
Subject: Excel Stuff

Just going to park a little thread here..

Not for work or anything, just to improve my general skills at Excel, I have decided to make a spreadsheet to calculate a season football league ladder.

I started out calculating the margin on any game, and using the IF function to figure out if it was a win or loss based on whether the margin was >0 or not.

Then I hit a snag, what if it was a draw and the margin was actually zero?

Is there any sort of three-way logic function where I can specify if margin=positive then W, margin=negative then L, and if margin=0 then D

Sorry if this is a stupid question…. but there will be many more.

Reply Quote

Date: 13/05/2015 00:25:01
From: SCIENCE
ID: 721818
Subject: re: Excel Stuff

split it like

if (x > 0) { // do stuff
} else if (x == 0) { // do stuff
} else { // do stuff
}

=IF(A1>0,“positive”,IF(A1<0,“negative”,“zero”)

Reply Quote

Date: 13/05/2015 00:25:09
From: SCIENCE
ID: 721819
Subject: re: Excel Stuff

)

Reply Quote

Date: 13/05/2015 00:30:27
From: sibeen
ID: 721820
Subject: re: Excel Stuff

(

Reply Quote

Date: 13/05/2015 09:05:32
From: The Rev Dodgson
ID: 721832
Subject: re: Excel Stuff

sibeen said:


(

Stop messing up the SCIENTIFIC brackets sibeen.

)

Reply Quote

Date: 13/05/2015 09:08:10
From: Dropbear
ID: 721833
Subject: re: Excel Stuff

The Rev Dodgson said:


sibeen said:

(

Stop messing up the SCIENTIFIC brackets sibeen.

)

Yes. Not closing your tags is just rude /*

Reply Quote

Date: 13/05/2015 09:21:38
From: The Rev Dodgson
ID: 721838
Subject: re: Excel Stuff

You can also use a lookup table:

Put
-9.9E307 negative
0 zero
2.23E-308 positive

in cells A1 to B3, then if your number is in C1:
=VLOOKUP
will return negative, zero or positive.

This option is useful when you have more than three options, when multiple nested Ifs become confusing.

It also allows you to put a range on values that will be treated as zero:

-9.9E307 negative
-1 zero
1 positive

will return zero for anything greater or equal to -1 and less than 1

Reply Quote

Date: 13/05/2015 09:24:28
From: The Rev Dodgson
ID: 721839
Subject: re: Excel Stuff

Actually:
=VLOOKUP (C1, A1:B3,2)

will work better.

Reply Quote

Date: 13/05/2015 21:27:00
From: party_pants
ID: 722253
Subject: re: Excel Stuff

Beauty, thanks Rev. I’ll have a play with it now.

Reply Quote

Date: 13/05/2015 21:28:47
From: bob(from black rock)
ID: 722254
Subject: re: Excel Stuff

party_pants said:


Beauty, thanks Rev. I’ll have a play with it now.

Stop when you need glasses

Reply Quote

Date: 13/05/2015 22:20:10
From: party_pants
ID: 722269
Subject: re: Excel Stuff

That worked beautifully…

but what do these bits:


-9.9E307

2.23E-308

actually mean?

It worked, just asking for a bit more understanding.

Reply Quote

Date: 13/05/2015 23:47:06
From: party_pants
ID: 722311
Subject: re: Excel Stuff

Fill formating. locking the cell range?

- told ya there were lots of stupid questions…

I’ve got a SUMIF formula to scan through a column and add up only the points for Adelaide (being first in alpha order).
Next row is Brisbane, I want to copy the formula to scan through the same columns but look for Brisbane. Then in turn Carlton, Collingwood and so on for each team.

I tried to fill the formula by dragging down, but it shifts the Range and Sum_Range by +1 each time.

I want to lock the Range and Sum_Range and have fill formating only adjust the Criteria.

Is there a way to do it?

Reply Quote