<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Excel:  How to write a formula that calculates weekly pay?</title>
	<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay/</link>
	<description>Comments on Ask MetaFilter post Excel:  How to write a formula that calculates weekly pay?</description>
	<pubDate>Wed, 07 Jun 2006 08:06:14 -0800</pubDate>
	<lastBuildDate>Wed, 07 Jun 2006 08:06:14 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Excel:  How to write a formula that calculates weekly pay?</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay</link>	
		<description>Excel:  How do you write a formula that calculates weekly pay? &lt;br /&gt;&lt;br /&gt; The problem I&apos;m trying to turn into a formula in Excel would operate something like this:&lt;br&gt;
0 - 40 hours = hours * base pay&lt;br&gt;
40 - 60 hours = (hours * (base pay * 1.5)) + the above calculation&lt;br&gt;
60 - 80 hours = (hours * (base pay * 2)) + the above calculations</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.39704</guid>
		<pubDate>Wed, 07 Jun 2006 07:54:50 -0800</pubDate>
		<dc:creator>dabradfo</dc:creator>
		
			<category>Excel</category>
		
	</item> <item>
		<title>By: Touchstone</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612460</link>	
		<description>=if(hours&amp;gt;60,(hours-60)*basepay*2+40*basepay+20*basepay*1.5 ,if(hours&amp;gt;40,(hours-40)*basepay*1.5+40*basepay,hours*basepay))&lt;br&gt;
&lt;br&gt;
Ugly, but it should do the job I think. I have assumed that if anyone works more than 80 hours, they earn double pay for the additional hours also.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612460</guid>
		<pubDate>Wed, 07 Jun 2006 08:06:14 -0800</pubDate>
		<dc:creator>Touchstone</dc:creator>
	</item><item>
		<title>By: kindall</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612462</link>	
		<description>Assuming hours is in A1 and base pay&apos;s in B1:&lt;br&gt;
&lt;br&gt;
=A1*B1+MAX(0,MIN(60,A1)-40)*B1*0.5+MAX(0,MIN(80,A1)-60)*B1</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612462</guid>
		<pubDate>Wed, 07 Jun 2006 08:07:00 -0800</pubDate>
		<dc:creator>kindall</dc:creator>
	</item><item>
		<title>By: jimmy0x52</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612464</link>	
		<description>Assume the hours are input into A1 and the base pay is A2&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
In a different cell, this would be the formula:&lt;br&gt;
&lt;br&gt;
=IF(A1&amp;gt;60,((A1-60)*(A2*2))+(20*(A2*1.5))+(A1*A2),IF(A1&amp;gt;40,((A1-40)*(A2*1.5))+(A1*A2),A1*A2))&lt;br&gt;
&lt;br&gt;
Enjoy.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612464</guid>
		<pubDate>Wed, 07 Jun 2006 08:07:48 -0800</pubDate>
		<dc:creator>jimmy0x52</dc:creator>
	</item><item>
		<title>By: jimmy0x52</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612465</link>	
		<description>Disregard mine - math error.&lt;br&gt;
&lt;br&gt;
Touchstone got it right.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612465</guid>
		<pubDate>Wed, 07 Jun 2006 08:08:46 -0800</pubDate>
		<dc:creator>jimmy0x52</dc:creator>
	</item><item>
		<title>By: kindall</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612467</link>	
		<description>My formula doesn&apos;t work above 80 hours. To fix that:&lt;br&gt;
&lt;br&gt;
=A1*B1+MAX(0,MIN(60,A1)-40)*B1*0.5+MAX(0,A1-60)*B1</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612467</guid>
		<pubDate>Wed, 07 Jun 2006 08:09:09 -0800</pubDate>
		<dc:creator>kindall</dc:creator>
	</item><item>
		<title>By: kindall</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612471</link>	
		<description>Further simplification of mine: =A1*B1+MAX(0,MIN(60,A1)-40)*B1/2+MAX(0,A1-60)*B1</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612471</guid>
		<pubDate>Wed, 07 Jun 2006 08:11:15 -0800</pubDate>
		<dc:creator>kindall</dc:creator>
	</item><item>
		<title>By: necessitas</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612473</link>	
		<description>I think I might make the following columns:&lt;br&gt;
&lt;br&gt;
A= date&lt;br&gt;
B=regular hours&lt;br&gt;
C= overtime 1&lt;br&gt;
D= overtime 2&lt;br&gt;
E total&lt;br&gt;
&lt;br&gt;
For each row, you would enter in the info, so if you worked 75 hours, it would your b-d values would be 40, 20, 15. For this example, let&apos;s assume base pay is $5&lt;br&gt;
&lt;br&gt;
your calculation in the total cell would be:&lt;br&gt;
&lt;br&gt;
=(b*5)+(c*7.50)+(d*10)&lt;br&gt;
&lt;br&gt;
I could be totally way off on this, it has been ages since I used excel for something like this.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612473</guid>
		<pubDate>Wed, 07 Jun 2006 08:13:12 -0800</pubDate>
		<dc:creator>necessitas</dc:creator>
	</item><item>
		<title>By: necessitas</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612474</link>	
		<description>That should be =(b1*5) + etc.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612474</guid>
		<pubDate>Wed, 07 Jun 2006 08:14:55 -0800</pubDate>
		<dc:creator>necessitas</dc:creator>
	</item><item>
		<title>By: Chunder</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612475</link>	
		<description>Pipped (on preview) by several good solutions; I like Kindall&apos;s - I&apos;d never previously found a useful use for the min/max functions...&lt;br&gt;
&lt;br&gt;
Anyway, my first reaction would have been to write a macro, for ease of flexibility and reusability:&lt;br&gt;
&lt;br&gt;
Alt-F11 to enter the VB editor&lt;br&gt;
On the little &quot;Project - VBAProject&quot; window in the top left, open up a folder called &quot;Modules&quot; - if it doesn&apos;t exist, select Insert&amp;gt;Module (from the menu). Double-click &quot;Module1&quot; to open it up in the edit window.&lt;br&gt;
&lt;br&gt;
Paste the following code:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;Function weekly_salary(hours_worked As Double, base_hourly_salary As Double) As Double&lt;br&gt;
&lt;br&gt;
If hours_worked &amp;lt;= 40 Then &lt;br&gt;weekly_salary = hours_worked * base_hourly_salary&lt;br&gt;
ElseIf hours_worked &amp;lt;= 60 Then&lt;br&gt;hours_worked = hours_worked - 40&lt;br&gt;weekly_salary = (40 * base_hourly_salary) + (hours_worked * base_hourly_salary * 1.5)&lt;br&gt;ElseIf hours_worked &amp;gt; 60 Then&lt;br&gt;hours_worked = hours_worked - 60&lt;br&gt;weekly_salary = (40 * base_hourly_salary) + (60 * base_hourly_salary * 1.5) + (hours_worked * base_hourly_salary * 2)&lt;br&gt;
End If&lt;br&gt;
&lt;br&gt;
End Function&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
If A1 holds your hourly salary, and A2 your hours worked, invoke the function by writing the following (e.g. in cell C1)&lt;br&gt;
&lt;br&gt;
=weekly_salary(A2, A1)&lt;br&gt;
&lt;br&gt;
And Bob is, apparently, your uncle...&lt;br&gt;
&lt;br&gt;
&lt;small&gt;Although, as per Touchstone&apos;s post, I&apos;d pay double rate for any hours worked over 80 in a given week...&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612475</guid>
		<pubDate>Wed, 07 Jun 2006 08:14:57 -0800</pubDate>
		<dc:creator>Chunder</dc:creator>
	</item><item>
		<title>By: kindall</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612476</link>	
		<description>Aaaand a further simplification of mine:&lt;br&gt;
&lt;br&gt;
=A1*B1+MAX(0,A1-40)*B1/2+MAX(0,A1-60)*B1/2&lt;br&gt;
&lt;br&gt;
Here&apos;s how it works:&lt;br&gt;
&lt;br&gt;
=A1*B1 = base wage&lt;br&gt;
&lt;br&gt;
+MAX(0,A1-40) = number of hours above 40, or 0 if it&apos;s 40 or less&lt;br&gt;
&lt;br&gt;
*B1/2 = additional half-time for hours above 40 (or nothing if 40 or less)&lt;br&gt;
&lt;br&gt;
+MAX(0,A1-60) = number of hours above 60, or 0 if it&apos;s 60 or less&lt;br&gt;
&lt;br&gt;
*B1/2 = additional half-time for hours above 60 (or nothing if 60 or less). since we have already given an time and a half for hours above 40, and 60 is above 40, this means that hours above 60 get double-time.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612476</guid>
		<pubDate>Wed, 07 Jun 2006 08:16:09 -0800</pubDate>
		<dc:creator>kindall</dc:creator>
	</item><item>
		<title>By: Chunder</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612484</link>	
		<description>&lt;small&gt;uh... and just on the off chance that someone ever wants to use that macro, the 60 in the final &quot;weekly_salary=&quot; ... line should actually be a 20. Whoops. &lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612484</guid>
		<pubDate>Wed, 07 Jun 2006 08:23:54 -0800</pubDate>
		<dc:creator>Chunder</dc:creator>
	</item><item>
		<title>By: mediaddict</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612571</link>	
		<description>Minor simplification of the Kindall Method:&lt;br&gt;
=B1*(A1+MAX(0,A1/2-20,A1-50))</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612571</guid>
		<pubDate>Wed, 07 Jun 2006 09:44:43 -0800</pubDate>
		<dc:creator>mediaddict</dc:creator>
	</item><item>
		<title>By: Sharcho</title>
		<link>http://ask.metafilter.com/39704/Excel-How-to-write-a-formula-that-calculates-weekly-pay#612689</link>	
		<description>A &quot;cleaner&quot; solution is to use Excel Array Formulas for this kind of thing, but it&apos;s an overkill for this specific problem.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39704-612689</guid>
		<pubDate>Wed, 07 Jun 2006 11:24:56 -0800</pubDate>
		<dc:creator>Sharcho</dc:creator>
	</item>
	</channel>
</rss>
