Go Back   Sports Car Forum - MotorWorld.net > Hobbies and Leisure Time > Computers, Consoles, Gadgets And Gizmos



Reply
 
Thread Tools Display Modes
Old 09-08-2005, 07:58 PM   #1
abbor
Regular User
 
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
Default 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?
abbor is offline   Reply With Quote
Old 09-08-2005, 08:54 PM   #2
SFDMALEX
Regular User
 
Join Date: Jun 2003
Location: Canada
Posts: 5,337
Default

Computers suck. Grab a pencil a peice of paper and a calculator.
SFDMALEX is offline   Reply With Quote
Old 09-09-2005, 02:28 PM   #3
abbor
Regular User
 
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
Default

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
abbor is offline   Reply With Quote
Old 09-09-2005, 06:25 PM   #4
AlienDB7
Regular User
 
Join Date: Jun 2003
Location: Canada
Posts: 1,914
Default

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
AlienDB7 is offline   Reply With Quote
Old 09-09-2005, 06:47 PM   #5
abbor
Regular User
 
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
Default

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...
abbor is offline   Reply With Quote
Old 09-09-2005, 07:23 PM   #6
pharzo
Regular User
 
Join Date: Oct 2004
Location: Warsaw, Poland
Posts: 526
Default

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.
pharzo is offline   Reply With Quote
Old 09-09-2005, 08:53 PM   #7
Overmind
Regular User
 
Join Date: Nov 2003
Location: Czech Republic, Europe
Posts: 667
Default

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.
Overmind is offline   Reply With Quote
Old 09-09-2005, 11:51 PM   #8
pharzo
Regular User
 
Join Date: Oct 2004
Location: Warsaw, Poland
Posts: 526
Default

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.
pharzo is offline   Reply With Quote
Old 09-10-2005, 03:25 PM   #9
abbor
Regular User
 
Join Date: May 2004
Location: Trondheim, Norway
Posts: 1,068
Default

Well, to write a trillion ifs, I'd use more than a lifetime so that's not a problem...
abbor is offline   Reply With Quote
Old 09-10-2005, 05:15 PM   #10
Overmind
Regular User
 
Join Date: Nov 2003
Location: Czech Republic, Europe
Posts: 667
Default

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.
Overmind is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump