Tracker
HOME    TRACKER    Excel

# Formula To Calculate Pay Stub

## I need help to create a formula to calculate pay stub. The calculation is based on a default start date of 1/1/2006. The end date will the pay period ending in the employee paystub.We would then use the Year To Date amount to calculate the monthly salary. I need to build this into an excel formula but could not find the correct formula.

Related Forum Messages:
Formula To Calculate How Much Tax To Pay
Working from cell D19 I am trying to find a formula to calculate how much tax to pay.
I have a TAXABLE INCOME figure (in cell D18) , from this figure

The FIRST £1520 should be multiplied by 0.1 (in cell C19,)
The next £26880 should be multiplied by 0.22 (in cell C20, the answer to be put into D20)
Any remaining from the Taxable Income figure (put into cell C21), should be multiplied by 0.4 (the answer placed in cell D21)

Formula To Calculate Pay Based On Hours Worked
i am trying to make an excel spreadsheet so i can keep track of my hours and pay at work... i know how to do mult and add but i wanted to know how to do the 2 together.... for example

Hours ST OT Total Hrs Gross Pay

8 2 10 ?

i would like help figuring out the gross pay if say for example my st time rated is 21.21 an hr, and the ot rate is 31.82 how can i get the 8 times 21.21 = 169.68 and the OT 2hrs times 63.64 to show up in the gross pay as a total of 233.32 - what would the formula look like?

Calculate BiWeekly Pay Periods
I have been working on solving this riddle since yesterday. What I'm trying to do is have Excel use today’s date on the computer to tell me when my Paydays are in a given month. Or have it tell me the next two or three Paydays based on Today's Date.
I can get Excel to calculate Every Two Weeks by using the formula =A3 + 14 then have each sequential field add 14 days to the previous fields date. However what I end up with is just a column of Pay Dates. Not what I'm looking for. I want to have an active page that only shows 2 or 3 future Pay Days. I want to use the function =TODAY() in my formula so that every time I open up the file it can calculate the next Pay Dates automatically.

I have been playing around with this formula:.....

All this does is tells me the First Friday of every month. This won't work for me because the Pay Periods are separated by 14 days not the 2nd and 4th Friday of every month. Here is an example of my Pay Periods: Sep 19, 2008; Oct 3, 2008; Oct 17, 2008; Oct 31, 2008; Nov 14, 2008; Nov 28, 2008; Dec 12, 2008; Dec 26, 2008; etc.......

Calculate Net Pay After Tax
building a spreadsheet. I have the total price in cell f6. In cell C6 I need price with no taxes. D6 should be the pst of 8% and E6 should be the gst of 5%.

Calculate A Pay Back Period For A Certain Investment
I need to calculate a pay back period for a certain investment. Excel has options for NPV and IRR but not for the Pay back period. (PBP). I've tried finding a solution using google discussion groups and some books but nothing helped me out. attached you'll find an example of my sheet. I need the PBP to be calculated in e.g. 5,3 years. but when the figures change it should automaticly recalculate the PBP.

Calculate Pay For Mileage While Factoring In The Number Of Participants
I'm trying to do is calculate pay for mileage while factoring in the number of participants. In other words, if the mileage was between 0 and 50 miles, and there were 5 or less people, then this cell should be \$35.00. But if it's between 0 and 50 and there were more than 5, then this cell should display 175/the number of people (175 being 35 * 5). In other words, more than five people would receive an equal amount of the total pay for five people (this is because five people are the standard, but there are instances in which six or seven could participate and I was hoping to avoid hardcoding that).

The rest of the if statements simply follow that same formula, but for different mileage/pay rates.

Calculate Total Pay Based On Sliding Percentage Scale
I am trying to set up a spreadsheet where all the sales manager will have to do is input the number of cars sold to determine what the total amount of commission will be for a salesperson. I have something set up so far, but need the spread sheet to do an if/then type thing where it will search the table, and produce the dollar amount for the number of cars sold based on the scale and the number in the # cars sold cell.

I've tried conditional sum, IF, goal seek, and all kinds of stuff to no avail. The spreadsheet is attached.

Lookup Wage Calculations (calculate Pay Per Shift Dependant On The Type Of Shift)
I have the basics set up, but need to work out how to make it calculate my pay per shift dependant on the type of shift i have worked.

I have attached a screen shot of the current page,

In it i have currently used validation drop boxes for the location and worked columns with tables just to one side of the sheet.

The shift pay is the column i am having trouble with.

I would like it to change dependant on what is selected in the 'worked' column.
For most things it should just display basic plus holiday, however if supervisor is selcted in the work column, it should display basic plus holiday plus supervisor.

Calculate Pay For Shift Work With Different Rates Based On Shift Hours
a person works for certain hours and get paid according to the hours worked either by day or by night or a mix of both. Day payment is \$8 when worked between 08:00 and 19:59 , night payment is \$12 when worked between 20:00 and 07:59. The excel cell are formatted as datetime with yyyy-mm-dd hh:mm , the function works fine in getting the time information and checking whether the whole work is all day or all night , yet the if-then-else statements for calculation seems to be wrong!!

examples:

start = 2008-01-01 09:15 , end = 2008-01-01 11:40 , all day as it is between 08:00 and 20:00 and cost = 8/hr = 19.333

start = 2008-01-03 21:05 , end = 2008-01-04 02:05 , all night as it is between 20:00 and 08:00 and cost = 12/hr = 60.000

start = 2008-02-02 19:00 , end = 2008-02-02 20:05 , cost = 9.000 as 1 hour day = 8.000 plus 5minutes night = 1.000

Function prod(st As Date, en As Date) As Double
Dim shour As Integer
Dim smin As Integer
Dim ehour As Integer
Dim emin As Integer
Dim stod As String
Dim etod As String
pday = 8
pnight = 12
shour = Hour(st)
smin = Minute(st) + shour * 60
If (shour >= 8 & shour < 20) Then
stod = "day"
Else
stod = "night"
End If
ehour = Hour(en)
emin = Minute(en) + ehour * 60
If (ehour >= 8 & ehour < 20) Then.................

Holiday Pay
I need a formula to compute holiday pay. I am having problems when there are two holidays during the month and the hire date of the employee is after the first holiday. For instance in November, November 11 and November 26 are holidays. If the employee is hired before November 11, he gets paid for the two holidays. If he is hired after November 11, he only gets the second holiday.

A B C 1 HOLIDAYS 2 HIRE DATE RATE/ 11-Nov-09 3 HOUR 26-Nov-09 4 5 10/15/2009 60.00 6 11/16/2009 60.00 7 11/28/2009 60.00 8

Holiday Pay Calculation
I have a problem with a cell displaying the correct number of days.

We work a 38 hour week and therefore each day is 7.6hrs

I have a start date and current date and calculate the number of days employed. I know that each day employed is worth 24 minutes, so over the year it calculates to 20 days per annum.

as I have not entered all the hours taken off yet, my current holiday entitlement is 767:04 (hh:mm).

when I process this on the calculator it tells me I have nearly 101 days holiday due, but I can not get excel to display XX:XX:XX (DD:HH:MM)

What would like to know is how many days that equates to using the 7.6 hour days

Trucking Company Pay
Here is the Scenario, A friend of mine who works for a Trucking company asked me this Question; This is How their company calculates His Pay for the Trips that he Makes.
@ first 100 Meter + Loading A Value of 1 Which will be Multiplied by the weight of the Load “L” and then a Flat Fee of “X’, And Off course The weight is not of any Issue for us for time being.

@ first 100 Meter + Loading A Value of 1 * X
@ Next 500 Meter a value of Max. 500-100=400 => 400/100= 4, then A Value of 4 * Y, Then if Total Traveling is 350 Meter, There we will have 1*X*L + 2.5*Y*L
And again L is not important and for time Being Could left Out.
@ Next 10 Kilometer A value of [Number of Kilometer - .5]*Z Then Max would be 9.5 * Z
@ Traveling of Over 10 and Less Than 30 Kilometer would be [Number of Kilometer – 10] * W Then a Traveling of 27 would be 17 * W
@ Over 30 Kilometer a Value of [Number of Kilometer – 30] * V
And Finally all these would be added up accordingly.

So far so good, and There is no Problem and Easily I can Use Excel To Calculate Every thing for me Just by Entering the Total travel amount and the Weigh of the Load, Using If, And Vlookup.
But Here it gets Complicated, They have these Following additional Conditions;

1: If the Traveling Road is a High way or Major Paved Roads Then all the above Values would be multiply by .77
2: If the Road is a Semi Paved Road then all the Above Values would be multiplies by .9
3; If the Road is a Dirt Road then all above would be Multiply by 1

For Example if the Traveling is 17 Kilometer and 2 kilometer is Dirt at the Beginning, and 2 Kilometer is the semi Paved at the end and the Rest are Fine Paved Road.

1*X*1+ 4*Y*1 + 1.5*Z*1 + 8*Z*(.77) + 5*W*(.77) + 2*W(.9)

Filtering For Multiple Pay Types
I need to find the total \$ collected on repair orders that contain customer pay and warranty repairs. The problem is that C and W show up on differerent rows, if an RO has 4 lines 3 may be c and 1 line w. I don't know how to use pivit tables to get the info I am looking for, or if that is the best way to fnd my answer.

Payroll Extract To Work Only On Certain Pay Period Dates.
I currently have an Excel payroll extract that populates a start date and end date via the calender control 11 user form.

What I have found out is I need to inject some sanity to this application. I can not have users select days that are outside of a pay period.

The users should only be able to select the first or the 16th of the month for a pay period start. Then they can only select the 15th or the 28th/31st for the pay period end.

What I am trying to do is have them select the month and the pay period start date, then the end date would automaticly be selected. But I don't want to have to create a bunch of loops to counter for the differing month end dates or leap years.

A Formula Which Is Calculate 4-5 Dates Formula In One Cell
i need a formula for which calculate all cell (calculating years months and days formula). FIND ATTACHED .xls file i need a answer in cell highlited in yellow color.

Formula To Calculate A %
I use this formula to calculate a %, but naturally when there is a 0 excel returns the #DIV/0! error. Can someone fix my formula so the error gets replaced with a 0
in the formula the 0 would be in cell W2 =IF(N2="yes",BN2/W2,0.5).

Formula To Calculate Discounts
I have attached an example ....

If both of the discounts being offered are positive then I am ok with.
In this example the first discount ofered is -25% and the second one is +50%.

If the required charge is higher than the standard charge then, in this example, the final charge should give the value as 2,500.

What would the formula be that added up the 2 discounts together and gave the correct value in cell B8?

Formula To Calculate Age
i am trying to build a formula to calculate a persons age.

I have tried using the DATEIF function but i keep getting a N/A

Calculate A Baseline Formula
I am trying to calculate a baseline average sales formula skipping weeks were there was a promotion. The maximum weeks = 8. In my table, promotions are indicated by equal values in the promotion column (C) and weekly sales column (A). If there was no promotion a 0 is in column (C).

Beginning the formula in cell B10, If A10<>C10, average A10:A2
If a11 = c11, average A10:A3 ( move up a cell in Col A and average that cell with the preceeding 7 numbers).

=AVERAGE(IF(A10<>C10,A3:A10,A2:A9))

However, if another value in A equals the corresponding C values within the averaging range (i.e. A8=C8), I want to skip "A8" in the average calculation and include the next cell outside the range (A2 or A1). In other words, I want to average a maximum of 8 preceeding entries in Col A that meet the criteria A<>C.

Formula To Calculate Turnaround
I am trying to calculate the number of items that took more than 5 days to complete.

The user enters the month and the year for which stats are required in G5 and G6, respectively (e.g., February and 2008). Both cells are formatted as General.

Column D contains the start dates, while column Q contains the completed dates.

I used the following formula but I am not getting the expected result:

PHP
=SUMPRODUCT(--(DATE(YEAR(\$D\$10:\$D\$12),MONTH(\$D\$10:\$D\$12),DAY(\$D\$10:\$D\$12))>=DATE(\$G\$6,CHOOSE(MATCH(\$G\$5,{"January","February","March","April","May","June","July","August","September","October","November","December"},0),1,2,3,4,5,6,7,8,9,10,11,12),1)),--(DATE(YEAR(\$D\$10:\$D\$12),MONTH(\$D\$10:\$D\$12),DAY(\$D\$10:\$D\$12))<=DATE(\$G\$6,CHOOSE(MATCH(\$G\$5,{"January","February","March","April","May","June","July","August","September","October","November","December"},0),1,2,3,4,5,6,7,8,9,10,11,12)+1,0)),--(\$D\$10:\$D\$12<>""),--(\$Q\$10:\$Q\$12<>""),--(DATE(YEAR(\$Q\$10:\$Q\$12),MONTH(\$Q\$10:\$Q\$12),DAY(\$Q\$10:\$Q\$12))-DATE(YEAR(\$D\$10:\$D\$12),MONTH(\$D\$10:\$D\$12),DAY(\$D\$10:\$D\$12))>5))

Formula Calculate The Percentage
I have a row of numbers from 1 to 26 in cells A1 to Z1 representing numbers
'chosen' at random by 500 unique people.

I have another row of numbers representing the 'frequency' that the
aforementioned number was chosen in cells A2 to Z2.

Example:

1 2 3 4 5 6 7 8 9 10 11 ...
10 4 16 9 23 20 61 13 18 43 17 ...

Is there a formula that I could use to calculate the percentage (0%-100%)
that each number was chosen?

Formula - How To Calculate For The 35 Min At Say 15.24
i just started with a company Royal Mail and they have some very strange timings for starting and finishing and i need a formula to help me work my money out and my hours to the precise min.

for example i have a shift comming up this week and my start time is down for 22:45 and my calculated finishing time is 07:23. i need a formula that will show on a spread sheet my exact time of work.

the other time i had was 22:35 to 06:35...it all seems prity simple to alot of people but this is my other problem. if i work from 06 - 18:00 i get one rate and if i work from 18 - 06:00 i get another rate.

so i need to know how to calculate for the 35 min at say 15.24 ph.

Formula To Calculate Penalties
i am trying to make a wage sheet calculator using excel.. and the problem arised was that how to deduct late fine .. i have a sheet which says for example if he is late for 15min then 10\$ and if he is late for 30 min then 15\$ ..etc..

how to write the formular if the person of salay say 1000\$ range comes late after 15min. 30min . 60min .etc...

Calculate Formula According To Date
I am creating a proforma income statement for a business plan and need the cell values to calculate (or not) depending on the startup date that is entered on another sheet.

The following formula works if the value of Startup!\$C64 is "March", but if it's "February" it returns 0.

=IF(AND(Startup!\$C64<="March",Startup!\$D64=2008),Assumptions!\$S17*P\$3,0)

What I'm trying to do is have the cell on the income statement only perform the calculation if the startup date is earlier or the same as the month referenced in the formula.

Perhaps I can't use the "<" with text?

Formula To Calculate 2 Cells
I have conditional statement {=SUM(IF('name of sheet'!\$H\$2:\$H\$226=H8,1,0))}

When ever I try to add a 2nd condition in using the wizard, I get incorrect results.

H8 is the cell that I want the calculation based on. How do I put on there that I want the calculation based on H8 or H9. If the answer is an easy one I apologise in advance. I'm a newbie to excel.

Formula To Calculate The Value Over Limit
I need to work out a formula to calculate the “value over limit” in the following scenario:

Cell D11 contains a total balance (input manually)
Cell D1 is the total of cells E to H
Cell A1 contains the formula to calculate the % of Cell D1 against the balance in Cell D11
Cell B1 will used to input a credit limit which will either be blank or the value of the limit

In Cell C1 I need a formula that will return 0 or value over limit based on the following-

Formula to calculate the value over limit: If cell A1 >10% of Cell D11 return the value difference between 10% of Cell D11 and the value in Cell D1
example; cell D11 = £100,000 & cell D1 = £22,000 (cellA1 = 22%): 10% would be £10000 therefore, the result would be £12,000 over limit

However, the comparison also has to take account of Cell B1. If this contains a balance then this needs to be taken into account e.g. in the example shown, if cell B1 contained a balance of £5000 then the result would be £7000 over limit or if the figure was =>£12000 the result would be 0.

If the % in Cell A1 is <10% the value is always returned as zero in Cell C1 regardless of any balance in Cell B1.

Refuses To Calculate A Formula!
I have a spreadsheet that I was sent (with some resource calculations on it - nothing major or huge) and I have added a sheet to it. The issue is that, on the existing sheets, any formula I add works but on the new sheet - they don't!. I get on the new sheet is the formula written out in the cell:

I have
- looked at the formula and it is correct
- cut and paste all sheets (values only) into a new sheet
- had a look in the VBA window - nothing stood out

Formula To Calculate Best Of Three Numbers
how to calculate the best of three numbers from 5 numbers in a row?

I want to know the exact formula for this.

Formula: Calculate Percentage
I have in row D a list of numbers and in cell F a list of salaries. I need a forumla to tell me what percentage D1 is of F1 etc.

IE the formula will be something along the lines of D1 * 12 / F1 * 100

Formula: Calculate Commision Of 10%
i need a formula to calculate commision of 10% eg. E14=\$1500. i need the answer to get 10% of that

Formula To Calculate Hours
im doing an excel spreadsheet. on 1st sheet i have a summary page for some clients, on sheet too i have worked out and done the formula so that it calculats values i put it. i want to take this total value i have worked out (which is a variable- will change from day to day) and move this value to sheet one. from here i want the number that i show in the summary page to deduct from a fixed total in the cell nxt to it. and ideas ive tried several options coming close but no ciga

Formula To Calculate Values From Words
There are five levels of Performance.

Not Evident(o), Emerging(1),Operational(2),Highly Functional(4),Exemplary(5)

There are ten rows of Categories of Performance.
There is one final column of Performance Summary for each category.

There are seven columns that are report sources of Performance.
There is one final row of Performance Summary for each report source.

There is one cell that is a final Summary of Performance Overall.

The cells have drop down lists of words only.

I need the Summary cells to show the result of calculation of the average for each row and column.

Calculate A Formula Instead Of Returning Text
I am compiling data from several different, variable, worksheets. I am using
concatenate to add the name of each worksheet into a formula to pull the
appropriate data.

However, it is returning the text of the formula instead of
the results of the formula. How can I make it calculate the result instead of
simply displaying the formula text?

Conditional Formula And Calculate Automatically
I am creating a sales per day/week worksheet for my reps to keep track of their sales. I have created the sheet that they only have to enter in what they have sold and it automatically calculates what they have sold per hour in the day, and what that makes their weekly total.

The problem is sometimes they will work 5 days, sometimes 4, sometimes 6 or 7.

im trying to fix the weekly average formula to divide by 7.5 for 1 day worked, 15 for 2, 22.5 for 3, etc all through 7...

this is the formula I have now, obviously it doesnt work

=IF(COUNT(B7:H7)=1,SUM(E42,E75,E110,E143,E175,E207,E238)/7.5,IF(COUNT(B7:H7)=2,SUM(E42,E75,E110,E143,E175,E207,E238)/15,IF(COUNT(B7:H7)=3,SUM(E42,E75,E110,E143,E175,E207,E238)/22.5,IF(COUNT(B7:H7)=4,SUM(E42,E75,E110,E143,E175,E207,E238)/30,IF(COUNT(B7:H7)=5,SUM(E42,E75,E110,E143,E175,E207,E238)/37.5,IF(COUNT(B7:H7)=6,SUM(E42,E75,E110,E143,E175,E207,E238)/45,IF(COUNT(B7:H7)=7,SUM(E42,E75,E110,E143,E175,E207,E238)/52.5)))))))

Formula To Calculate Staff Performance
I am trying to work out a % score for a telephone operator. To explain further, I would monitor a call that an agent takes. The agent starts at 100%. There are 20 points to be scored and they are scored like this

1 - Yes
0 - No
left blank - n/a

B3 counts the number of entries in the column
B2 counts the number of 1's in the column
B28 = B2/B3

Seems to work fine until the agent makes a fail which would enter a 0 in the column. Somewhere I think I need to take account that there are 20 possible fails or passes?

Logic Formula To Calculate Distance
I have a excel sheet with city names in Column A, Distances in Column B, and Distances in Column C.

I wanted to write a formula so excel checks the distance between column C and column B and if there is less than a 10% difference between the two then it would copy the name of that city into another column D.

Formula To Calculate Sick Days
I am trying to put a time sheet together that will place the number 8 in a cell when the work "sick" or vacation is in another cell.

For example, if I am out sick on monday, I would like to put "sick" in the cell next to monday and have the number 8 be placed in another place. Then If I am out "sick for three days I would like all of those "sick" days to add up to 24.

Formula To Calculate Hours Worked
I have this spreadsheet and in it the time is changed from military time to regular and then I use a formula to calculate hours worked. On some of these the total is off by one minute. Does anyone know how to fix this?

I don't know how to paste the spreadsheet so you can see formulas,

Stopping Formula To Automatically Calculate
Is there a way in which I can get excel not to run any formulas until I run some sort of command or click a button in order to tell it to?

For example, I have two sheets, one sheet has raw data entered manually into each cell, the other sheet has a large amount of formulas to calculate totals from this raw data. But every time a number is entered into a cell in the raw data sheet Excel says 'Calculating Cells', I want to be able to enter all my raw data, then go to my totals sheet and execute all my formulas.

Formula That Would Calculate What Workday A Date Would Be
I am trying to find a formula that would calculate what workday a date would be.

So if the date is 2/19/2007, I want to know that is the 13th workday.

Formula To Calculate Average Of Every Other Cell
I have a row of data starting in cell E4 that could, theoretically, go to the far right end of the spreadsheet. I need to enter a formula in cell D4 that calculates the average of every other cell in this row, starting with E4, that is E4,G4,I4,K4...

Formula To Calculate Totals From Three Different Sheets
I have to calculate the totals for every individual for the past three months. I have to do this for 200 people, is there a formula i could use to do this? Eg. if a person made 50 sales in Jan, 40 sales in Feb and 100 sales in March i need a formula that calculates the grand total, which will be 190.

Formula To Calculate Cell Location
i'm not sure how to describe this. i've never had to do this before. here is what i'm trying to do. and it's not working.

=MIN(B2:B(G2-G3))

basically instead of saying =MIN(B2:Bx)....i want the "x" to be variable based upong the G2-G3 condition. can this be done some other way?

Formula To Calculate Row HEIGHT
I need a formula to calculate the height of a cell. Basically I will repeat this formula thoughtout the database, and each cell in column U will have its row height.

have come up with the following

Function RangeHeight(rng As Range) As Double
RangeHeight = rng.Height
End Function

Now, the problem is, that the formula does not automatically update when the row height changes, and when I open the file on another pc, all the formulas change to #NAME since it does not recognise the custom formula.

Formula To Calculate Based On Criteria
I have a spreadsheet that has staff id in one column and the work items number that they have done in a daily basis in another column.

The actual list is very long. I need to summarize in another column how many work items that they have completed in a daily basis.

I have attached a sample spreadsheet as an example. I would need to summarize in column H based on the staff ID. Some work items are shared by two staff but it will have to be counted as one work item completed for each staff. If work item B123466 is completed both by staff M56 and M54, then it will be counted as one for each.Currently, I am doing this manually with the filter function which is very tedious and often has mistakes. I would like to formularize this task.

Conditional Formula To Calculate Total
I need a formula to calculate a total based on two conditions.

Formula's For Calculate Sales Commissions
I am trying to decipher how to calculate commissions for my sales reps. I have made just a simple spreadsheet to give you an idea of what I am doing. I have tried to us an IF formula but I think there are too many options( I have 9 reps). Basically I pay them either 10 or 15% so I need a formula to take the sales price - cost times their apporpriate %.

AgentSales Price CostComm Pd
AS150 75
JK255 185
JD325 250
JD125 50
AS50 10
AS50 10
AS335 250
JW75 25

Formula Does Not Calculate Numbered Customer Accounts
following calculation that someone created for me.

=LOOKUP(10^10,CHOOSE({1,2},0,AVERAGE(IF(Sheet1!\$C2:\$C13=\$A2,IF(Sheet1!\$B2:\$B13-DAY(Sheet1!\$B2:\$B13)+1=B\$1,Sheet1!\$D2:\$D13)))))

My problem is that I have some customer account numbers that are alpha/numeric (1B0012) and some that are just numeric (1675) . The above formula does not pick up the numeric accounts correctly.

Is there something that I need to add/remove from this formula so that it will pick up both? or is it a format issue?

I have attached an example of the spreadsheet with this problem. If you select either of the alpha numeric codes it works, but if you select the numeric code it doesn't.

Conditional Formula - Calculate Only If Net Unit Is Zero
Here's the table for one game

Profit/Loss(\$)
xx/xx----2----------------##--------------2--------------125---------- ##
xx/xx----##---------------1---------------1--------------150---------- ##
xx/xx----##---------------1---------------0--------------165---------- +65
xx/xx----##---------------4--------------(4)-------------170--------- ##
xx/xx----2----------------##-------------(2)-------------165---------- ##
xx/xx----##---------------1--------------(3)-------------180---------- ##
xx/xx----3----------------##--------------0--------------180---------- (10)

Number in bracket means negative.

## means empty cell.

How can I type a formula, so that every time there's no stock left (ie zero net
unit), it will calculate the net profit once.

Date/calculate Elapsed Time Formula
I have been asked to make some ammendements to a workbook currently in use.

I have to calculate elapsed time, and my formula is giving me odd results. I have a start time (cell B5), and an end time (cell F5). The formula being used was =IF(F5>0,((F5-B5)*24)) which gave the correct result. The cell is formatted as general. It didn't alot for the situation where the end time has not happened yet.

I changed the formula to =IF(F5>0,((F5-B5)*24),(K5-B5)*24) where cell K5 is the current time. The results are coming out with 6 - 9 decimal places. It makes no sense as I've tried setting the times to be exactly 24 or 48 hours to the minute. I've also tried replacing K5 in the formula to now(),