09-08-2005, 07:58 PM
|
#1
|
Regular User
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
|
Excel experts of the world, unite!
Okay, here's the situation...
At my work, we have this salary arrangement..
All days from Monday to Friday, I have 103,98 NOK before 18:00.
Between 18:00 and 21:00 I get 124,98 NOK.
Between 21:00 and 23:15 I get 144,99 NOK.
So I put together this Excel-doc to find out what I'm gonna earn:
http://home.no.net/redheadn/JW/Bok2.xls
The problem is that I'm not a very good programmer, this is the first time I ever used the IF-function in Excel.
I want to type in C and D when I have worked from and to, and then let Excel fill in the correct times under the different wages.
It works every time I fill in a time where I've worked within all the wages, but as soon there's one exception(See line 5), everything fucks up because of my code..
Can anyone please tell me what functions I should use instead of those I've used?
|
|
|
09-08-2005, 08:54 PM
|
#2
|
Regular User
Join Date: Jun 2003
Location: Canada
Posts: 5,337
|
Computers suck. Grab a pencil a peice of paper and a calculator.
|
|
|
09-09-2005, 02:28 PM
|
#3
|
Regular User
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
|
Please... Not anyone..?
I stayed up till 5 AM this night working on it, but I couldn't get it to work...
Here's my latest version:
http://home.no.net/redheadn/JW/Bok3.xls
|
|
|
09-09-2005, 06:25 PM
|
#4
|
Regular User
Join Date: Jun 2003
Location: Canada
Posts: 1,914
|
Here's a possible solution for you:
Set up 3 columns, one for each salary range... they will be used to store # of hours.
Let's say 3 the columns are E, F and G.
In column E, put down the formula (without quotes): "=MAX(0,MIN(D3,(1800/2400))-C3)"
In column F, put down the formula: "=MAX(0,MIN(D3,(2100/2400))-MAX(C3, (1800/2400)))"
In column G, put down the formula: "=MAX(0,MIN(D3,(2325/2400))-MAX(C3, (2100/2400)))"
You just have to multiple them with the corresponding rate to get the total salary for the day. Hope this works... if not, dont chase after me for your missing salary
|
|
|
09-09-2005, 06:47 PM
|
#5
|
Regular User
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
|
I made it... But I used a lot more advanced way than you alien... I used something like a trillion IFs, so I'm very, very confused right now, but I think I made it...
|
|
|
09-09-2005, 07:23 PM
|
#6
|
Regular User
Join Date: Oct 2004
Location: Warsaw, Poland
Posts: 526
|
I used something like a trillion IFs
|
In computer science, if that's the case, there's surely an easier way
__________________
RC45 about the Z06:
It is also a cheaply made, fast to depreciate, badly service hunk of GM crap.
|
|
|
|
09-09-2005, 08:53 PM
|
#7
|
Regular User
Join Date: Nov 2003
Location: Czech Republic, Europe
Posts: 667
|
Originally Posted by pharzo
I used something like a trillion IFs
|
In computer science, if that's the case, there's surely an easier way
|
lol you mean the switch - case construct ?
__________________
<---- Look into my Eye and shiver.
|
|
|
09-09-2005, 11:51 PM
|
#8
|
Regular User
Join Date: Oct 2004
Location: Warsaw, Poland
Posts: 526
|
that's just another way of writing if statements
what you want is a loop, or a recursive solution
__________________
RC45 about the Z06:
It is also a cheaply made, fast to depreciate, badly service hunk of GM crap.
|
|
|
|
09-10-2005, 03:25 PM
|
#9
|
Regular User
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
|
Well, to write a trillion ifs, I'd use more than a lifetime so that's not a problem...
|
|
|
09-10-2005, 05:15 PM
|
#10
|
Regular User
Join Date: Nov 2003
Location: Czech Republic, Europe
Posts: 667
|
Originally Posted by abbor
Well, to write a trillion ifs, I'd use more than a lifetime so that's not a problem...
|
*hint* well you can have them generated , just write a loop .
__________________
<---- Look into my Eye and shiver.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|