# Force Formulae Recalculation & Return Day Name From Workday Function

Feb 27, 2008

I'm trying to make a schedule of deposits made for the month of March 2008. (Deposits are made on a daily basis.) With this, I wanted to know when the deposit would clear with the bank using the WORKDAY formula given that I have to count 6 banking days after the date of deposit (Saturdays and Sundays excluded).

I'm using Mac and I recently upgraded to Office 2008 (never tried WORKDAY formula in other versions). I am aware of the syntax used for this formula and it works just fine in other cases. But I noticed that with start_dates falling on a Thursday or Friday of the week, Excel would give me a result date that falls on a Sunday, which is odd given that it's supposed to ignore non-working days or weekends. (I haven't even gotten to inputting holidays yet.)

## Force Recalculation Of Just One Row.

May 10, 2006

My spreadsheet is very large & takes sometimes 5 to 10 seconds to recalculate. The problem is that is was wanting to recalc every time I edited a cell, which I do constantly all day long. Due to this, I have turned off automatic recalculation. Is there is a way I can use VBA to force just one cell or just one row to recalculate? Keep in mind that currently no cells recalculate until I hit F9 or go in & manually hit Calculate Sheet in tools > options > calculation.

## Force Text Function To Return Number

Dec 15, 2006

I am using a MID fn to extract a single digit from a numeric string. I then use an IF Function to return a value based on the extracted digit. My IF statement works fine on manually entered digits but doesn't recognize my MID fn result. What am I missing?

## Function Recalculation With Change In Cell

Mar 28, 2007

I have just written a function that sums all the values in the cells in a range that are not green. This works however if one of the non green cells is changed to green the function does not work. i have to re input it into the cell that i put it into.

Function SumNotGreen(SelectedCells As Range)
' Adds the values of the cells where the font colour is not green(35).
Dim Cell As Object
Dim x As Double
x = 0
For Each Cell In SelectedCells
If Cell.Interior.ColorIndex <> 35 Then
x = x + Cell.Value
End If
Next Cell
SumNotGreen = x
End Function

How can i make the function recalculate i.e. go back into the loop every time a change is made.

## Forcing Recalculation After Custom Function Update

Apr 26, 2007

I have written a custom function which is called in lots of cells. It had an error so I modified it. But the modification did not automatically trigger recalculation in the cells where it is used. Neither did F9 (manual recalculation). The only thing that did is hitting F2 for the cell then ENTER. But what a pain to do that for every cell it's used.

## WorkDay Function VBA

Jul 31, 2008

The function is to show the next workday date in cell a1

## Workday Function Use In VBA

Aug 15, 2006

I have a spreadsheet setup that uses the workday function. Shown as follows: =Workday(P\$2-1,V2,Z2:Z\$11)

P2 is a set date in which the location will not change. Z:Z is a list of Holidays. V2 should offset by 1 row. I want it when a command button is hit it runs that formula untill the rows value = "End". I have found "Working with Workdays" information at MSDN's website http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbadev/html/workingwithworkdays.asp It seems to be for access but I'm trying to use in Excel and I am getting errors/confused. The main error I'm getting is Compile Error: Method or data member not found because of rst.FindFirst.

## Referring To Formulae In The Choose Function

Jun 27, 2007

I have a number of different formulae I want to invoke according to a choice. I am able to request the formula I want by entering them ‘in line’ as value1, value2 etc into the CHOOSE formula … e.g. =CHOOSE(\$H\$1,IF(N3>O3,1,""),IF(N3<O3,1,""),IF(N3=O 3,1,””))

but this is cumbersome and confusing since I have a growing number of choices and some of the formulae are quite long. I want to enter them in a list and extract the formula which corresponds with the Index_num in the CHOOSE formula. I also need the cells in the formulae to be relative so this rules out using NAMES to refer to the formulae.

## Workday Function Or Similar

Jan 3, 2007

This is probably a simple question, but one I can't figure out after several hours. I am creating a spreadsheet focused on certifications.

I need to take the date each initial certification was achieved, and add x years to each cert, which is simple enough.

The sticky part is that the (date + x years) can't logically be a weekend; if it is, I need to subtract one or two days from the result, so that it's the *weekday* immediately prior.

e.g. if my initial certification date is: 1/23/2006 and my certifcation expires in four 4 years:

A47= date(2006,1,23)
h47= 10

=DATE(YEAR(A47)+H47,MONTH(A47),DAY(A47))

Result = Saturday, January 23, 2010

If the result is a Saturday or Sunday, I need to subtract one or two days from the date. In this example, I'd like: Friday, January 22, 2010 as the result.

I've been playing with 'if', et. al., to no avail.

## Function That Is The Equivalent Of WORKDAY But For Hours Instead

Mar 14, 2007

I am in need of some excel advice relating to date calculations. Basically I need a function that is the equivalent of WORKDAY but for hours instead. I have a series of events that take a certain length of time to complete, most of them less than a day but some more than. By way of example see the screenshot below:

In reality the last three operations would have to take place on the 27th of April, with the Welding operation starting on the end of the 25th around 7pm. The plant is running a 24 hour day, and works 5 days a week. How can I calculate the times in hours offset rather than going day by day? I need to account for

* Weekends
* Fixed Holidays
* Operations running as seamlessly as possible

Any advice welcome. I have attempted to use WORKDAY with the number of days to deduct rounded to the nearest day and then subtracting the operation time but this results in errors where operations would cumulatively go over a working day. The objective is by knowing when the end product is needed and knowing how long each operation takes it is possible to discover when to start manufacture. VBA or Formula code is fine as this will be integrated into a VBA project.

## WORKDAY Function To Calculate The Start Date

Jun 11, 2009

As everyone realizes that WORKDAY function can return a working date that exclude weekends and any dates identified as holidays. However, what if I want to return a working date excluding my designated holidays but including weekends?

For example,

Holidays are 1 Jun 2009, 2 Jun 2009 and 4 Jun 2009

Start Date: ???
Finish Date: 8 Jun 2009
Duration: 5 days

The Start Date should be 30 May 2009.

Seems like I am not able to use WORKDAY function to calculate the start date.

## Workday Function/Formula Ignoring Weekends

Aug 8, 2006

I'm at my wits end trying to make a workday formula work, but am having no luck. I've searched the other posts, but did not quite find a match. I'm trying to subtract a number of days from a workday function, but it seems to bypass ignoring the weekends (as is supposed to be done automatically with Workday). Here's the formula I'm trying to use:

=WORKDAY(H5,L5,' Reference Info'!\$E\$110:\$E\$117)-(I5/8)

I5/8 is a column with hours - this just calculates a number of days to subtract based on the number of scheduled hours.

The formula will calculate, but it still ignores weekends. I've tried burying the I5/8 within the parenthesis, moving it around in the formula,

## Force Function To Use Row Relative To Cell Housing Function

Mar 2, 2008

I have been looking around have this much code from this site, modified. What I am trying to do is calculate numbers by a position with cells D through K having numeric values. I have 'hardcoded' the cells (D2, E2, etc in the code below), but in reality I only want the current row (so if the formula is on the 2nd row, I want D2, if it is on the 3rd row, I want D3).

My problem is obviously the formula isn't working because I am not correctly tying back to the spreadsheet (Positioncalc.xls). When I put the formula in the spreadsheet it works, but in my script I get 0 everytime.

My Script:

Function Position(rCell As Range, Optional RightPosition As Boolean)
Dim vResult

Select Case rCell.Text
Case "QB"
vResult = (2*D2) + (2*E2) + (2*F2) + (4*G2) + (2*H2) + (1*I2) + (4*J2) + (3*K2)
Case Else
vResult = "Invalid Position"
End Select

If RightPosition = True Then
Position = vResult
Else
Position = "Position not valid"
End If

End Function

So, when I put =Position(A2,True) I expect to see the formula results of those cells calculated based on the position (QB, HB, etc with their unique formulas).

My next challenge after this is to highlight certain cells based on the Position. So if A2 = QB, I want cell D2 boldface and Red, etc. I have seen some scripts on colors and such here, so I might be able to figure it out.

## How To Force TEXT To Return Date In English

Feb 6, 2014

I have a formula as follows:

Code:
=TEXT(A1,"Mmm YY")

Where cell A1 contains a date, say 01/01/2014.

For me this returns "Jan 14." However, I have a colleague using a Spanish version of Windows/Excel and therefore it displays this in Spanish as "ene 14."

How can I force the formula to return the English spelling, Jan 14?

## Force Update Of NOW Function

Aug 14, 2008

Is there a way to renew / update the formula =NOW() without closing & reopening the file??

## Force LEFT Function To Recognize A Number?

Jul 29, 2009

Basically I have a phone number in column A:

123-456-1234

In column B, I want it to show me the first 3 numbers from the left, (so 123)

So I do =LEFT(A2,3)

Which gives me 123, but it's displayed as text, which ruins my whole formula that looks up the area code and displays the state.

I googled the problem and found http://exceltip.com/st/Make_LEFT_Fun...umber/778.html

which tells me to do:
=IF(LEFT(A1,1)=1,"Ignore",A1) [sees 1 as a number]
=IF(LEFT(A1,1)+0=1,"Ignore",A1) [sees 1 as a number]
=IF(LEFT(A1,1)="1","Ignore",A1) [sees 1 as text]

but when i try that it just displays the ENTIRE phone number: 123-456-1234

## UDF Recalculation And Speed

Dec 11, 2006

I'm working on a financial reporting project that should be in Access but unfortunately it must be in Excel. Some of the formula are complex and I have a UDF to calculate these values. I added the line

Application.Volatile

to each UDF but when I change the current month in a dropdown box, the UDF's do not recalculate. The dropdown box sets a period number on one of the worksheets - this same value is passed to each UDF. I tried using this code in my dropdown box :

Sub DropDown4_Change()

Application.CalculateFull

End Sub
but the PC just hangs. I have hundreds (more likely thousands) of formula in the spreadsheet and the recalc is recalcing everything whereas I just want it to recalc the UDF's. I even changed all of the sumproduct formulae to array sum if formulae which sped things up - that is until I forced the full recalc on the drop down change event.

So my question is: is it possible to just recalc the UDF's on 3 worksheets when the user selects a different period in a dropdown box?

And a supplementary question : if {sum(if(...))} formula are faster than sumproduct formula, would a (well written) UDF perform faster than a {sum(if(...))} formula?

## Disable Certain Formulas During Recalculation

Aug 10, 2008

Two questions: is there a way to not have the formulas in a range of cells, say from B2:AX20, evaluated during normal recalculations? I would like the formulas evaluated only if a form button is pressed.

How do I link the recalculation of the disabled cells to the form button?

The range of cells do not require updating unless certain other cells on a different worksheet are changed which happens rarely. However, other cells in the workbook do change so I would like to keep recalculation set to automatic. I searched the site as well as C. Pearson’s site and some others and have not found a solution. Any help would be appreciated because at present my workbook is extremely slow.

## Prevent Recalculation Of Tables

Jan 25, 2008

I want to create a macro that changes the calculation when opening excel to calculating without updating tables. When I first open excel, the file takes a while to update because it is updating tables, and I want to prevent this. Any ideas? Also, I already have the following code, but this only changes the workbook once its already opened:

Private Sub Workbook_Open()
Application.Calculation = xlSemiautomatic
End Sub

## Function Returns Value To Cell As Single - Function Is Defined To Return Double

May 14, 2013

Function Haversine has correct value in debugger but in cell it has the same value as Haversine2. Is this a known bug?

Public Function Haversine(lat1 As Double, long1 As Double, lat2 As Double, long2 As Double) As Double
Dim temp As Double

[Code]....

## Affect Of Filtering On Formula Recalculation?

Feb 9, 2012

I have many formulas on my (inherited) spreadsheet in row 4 through 10000 Then in row 2 there are sumproduct and subtotal formulas

When I hide and show rows only the formulas in row 2 need to be recalculated. Yet, it recalculates ALL formulas

Is there any way to control which formulas get recalculated or is it locked to recalculate all of them

It really slows down the process

## How To Stop Recalculation When Cell Shows Certain Number

Jul 7, 2012

I have this sheet full of random data and I want to recalculate extra fast so I keep my finger on F9 which causes the random data to randomize really fast of course. Now, in B1:AT1 I have numbers that change with every recalculation but here is the problem. I want the recalculation to stop when excel identifies a zero in that range which doesn't happen often.

## Linked File Is Closed Before It Finishes Recalculation

Apr 27, 2007

I have a workbook with a button to get updated data. The button simply opens the other workbook and then closes it. THe problem is it opens the book and then closes it before the opened book has a chance to finish it calculation resulting in lots of #value errors. The book that is being opened works fine but because it is shared it can't be left open and needs to be closed asap, though it should be allowed to finsih calcs before it gets closed again. If anyone know a way to make the following temporarily halt until the opened book finishes calculating before it closes it.

Workbooks.Open Filename:= _
"X:gas daily pricingGD pricing weather call active summer.xls", ReadOnly:=True
ThisWorkbook. Saved = True
ActiveWindow.Close False

## Sum/Count By Color Recalculation With Conditional Formatting

Sep 12, 2007

I have just set up a conditional format to change the colour of my cells in column F based on a yes or no value in column E. I have a colour function formula working to sum the totals of the cells coloured the 2 different colours seperately. Since applying the conditional format. the formula for colourfunction will only total 0.
Is there a way i can apply the colourfunction formula to cells coloured by using conditional formatting

## Highlight A Cell If It Has Changed As A Result Of Formula Recalculation

Mar 7, 2007

I am looking for a solution which will highlight a cell if it has changed as a result of another cell changing (i.e. formula recalculate).

i.e.

A B C
3 2 (a*b)

I want cell c1 to be highlighted if either a1 or b1 are changed manually.

## How To Validate A Formulae

Jan 30, 2009

I have a database on one sheet and a 2 count if formulae recording information on the next to be exact one formulae counts the number of monthly values and the other count yearly values. I want the sum of these formulaes to be equal or less than 25. and to show an error if the sum of these is mor than 25.

Apr 30, 2009

I am slowly working my way thru Excel succesfully but have come up with another one I can't find an answer for..... YET

I simply want to subract the value of two cells, however the values of those cells are produced by formulae. Hence I get the #Value! error.

Once again I know there's gotta be a simple solution, I just can't locate it

## Convert All Formulae To Values

May 7, 2008

I need to add a piece of code to a spreadsheet that will turn all formulae within into values. The number of tabs in the spreadsheet is likely to change over time but I want the code to apply to all the tabs - without needing to change it if a tab is added/ deleted.

## Evaluate A 'dotted' Number Using Formulae (not UDF)

Apr 12, 2006

Is there any way to 'evaluate' a dotted number (similar to an IPv4
address but not just those) using standard worksheet formulae (ie no
UDFs, VBA, or ATP functions)?

To make it a little more complicated, I need to be able to evaluate
not just IP addresses (although that would be a use) but also a
'number' such as 9.0.2 compared to 8.7.5 so that they can be sorted
and / or compared.

The views expressed are my own, and not those of my employer or anyone
else associated with me.

My current valid email address is:

1bupdvc02@sneakemail.com

This is valid as is. It is not munged, or altered at all.

It will be valid for AT LEAST one month from the date of this post.

If you are trying to contact me after that time,
it MAY still be valid, but may also have been
deactivated due to spam. If so, and you want
to contact me by email, try searching for a
more recent post by me to find my current

The following is a (probably!) totally unique
and meaningless string of characters that you
can use to find posts by me in a search engine:

ewygchvboocno43vb674b6nq46tvb

## Formulae That Applies To All Sheets On Opening

Jan 14, 2008

is it possible to have a sheet that i can type in formulae and the formulae will automatically copy itself into the same cells on any new sheets i open?