I'm using the formula =NETWORKDAYS(start_date,end_date) to calculate the number of working days between an estimated delivery date and the actual delivery date of products.
It is working fine to some extent, however if there is a recorded delivery date but no estimated date, it provides a value of 29,600+. Similarly if there is an estimated date but no delivery date (ie the item hasn't yet been received) it returns a value of -29,600+.
What addition to this formula can I add to stop this happening?
Also, if the delivery date and estimated delivery date are the same, it returns a value of 1, when it should be 0?
Here's ideally what I want:
the two columns with dates in are E and M, and I want the following to happen:
When E is blank but N isn't, the value 'no est' will appear
When N is blank but E isn't, the value 'no del' will appear
When both E and N are blank, the value 'no data' will appear
When neither are blank, i want it to use the formula =NETWORKDAYS($E,$N) to calculate the amount of days between the two dates
This is the formula I have created, but excel won't accept it
=IF(E21=ISBLANK,(=IF(N21=ISBLANK,"no data","no est")),(=IF(N21=ISBLANK,"no del",(=NETWORKDAYS($E,$N)))))
Thanks
Similar to your attempt:
=IF(AND(ISBLANK(E2),ISBLANK(M2)),"no data",IF(ISBLANK(E2),"no est",IF(ISBLANK(M2),"no del",NETWORKDAYS(E2,M2))))
(probably could be abbreviated slightly, but relatively clear).
Related
i am stuck and need your help. i have a spreadsheet in which the main columns are PAIRDID, PREFERRED, AUDIT DATE. what i want to do is for every pairid there could be n number of dates so my result column (f) should be for every PAIRDID it should show me the audit date of last preferred marked as Y . Attached is the screenshot.
enter image description here
This will return the max value in column D for each unique PAIRDID IF they are marked as "Y" in column C. If the PAIRDID is marked as blanked, it will return a blank. Type this equation into F2 and then drag it down.
It is worth nothing that it will show you the same date on every duplicated PAIRDID that meets the criteria, but the date shown will always be the max.
=IF(AND(B:B=B2,C2="Y"),MAX(D:D),"")
This formulae "works", but it seems a bit long winded. Can anyone suggest an "easier" formulae. It returns the value in the 5th Column to a date in the 1st column which is called from a separate (and discrete) worksheet. If there is no data in the 5th column (because we haven't reached or passed that date), then the latest available data is called ($A$20, is the "calling date, on a current worksheet):-
IF(VLOOKUP($A$20,'[FTSE100.xlsx]Meteor Step Down
Plans'!$A$18:$E$2828,5)="",VLOOKUP(HLOOKUP(A20,'[FTSE100.xlsx]Meteor Step
Down Plans'!$A$18:$A$2628,MATCH(TRUE,INDEX(ISBLANK('[FTSE100.xlsx]Meteor
Step Down Plans'!$E$18:$E$2828),0,0),0)-1),'[FTSE100.xlsx]Meteor Step Down
Plans'!$A$18:$E$2828,5),VLOOKUP($A$20,'[FTSE100.xlsx]Meteor Step Down
Plans'!$A$18:$E$2828,5))
The formula is in a different workbook to the data. The formula is used to determine the last value in an array, the first column of which is a date range (01/01/2000 to 31/12/2027....say) The required data is in column 5. Entries may be up to date (i.e. the last entry was made today, therefore it will pickup todays value. The last entry may have been several days (weeks) ago, therefore it will pick up the last value in the designated column (column 5). I don't see why it can't go into a named range, as the array size is fixed. Does that help?
Thanks Ron, nearly there. That works beautifully for "missing" dates in the array. i.e. when Saturday and Sunday dates are missing, it finds the value (in column 5) of the previous Friday. However (and there is usually a "however"), if $A$20 is a date in advance of the date of the last data in the array i.e. column 5 is blank at that date, your formulae returns 0 (zero), instead of the data as at the last date that data has been entered. i.e. enter 02/04/2018 and your formulae returns 0, not the data at the last date available 28/02/2018. Is that a little more clear?? (Thank you anyway, for spending the time - I'm still trying to work out how your formulae works as it does. Is the "/" significant (other than being a "divide by" symbol, if so it's something I've never come across before? Regards...........Mike. P.S. The dates in the array (Column 1) are all in from 2016 to 2027 (excluding weekend and bank holidays), and are arranged in ascending order i.e. from 01/01/2016 to 31/12/2027
Ron - Sorry mate, buy I can't see a "second" formulae???
If I understand what you want to do correctly, (and that is hard to do since you give NO examples of your data, actual output or desired output), try:
=LOOKUP(2,1/((myDate>=A:A)*(LEN(A:A)>0)),E:E)
If it is the case that you have dates in column A and no entries in Column E, then you might have to do something like:
=LOOKUP(2,1/((myDate>=A:A)*(LEN(A:A)>0)*(LEN(E:E)>0)),E:E)
Of course, you will have to modify the cell references and named range to refer to the proper workbooks and cell.
Possibly something like:
=LOOKUP(2,1/(($A$20>='[FTSE100.xlsx]Meteor Step Down Plans'!$A$18:$E$2828)*(LEN('[FTSE100.xlsx]Meteor Step Down Plans'!$A$18:$E$2828)>0)),'[FTSE100.xlsx]Meteor Step Down Plans'!$E$18:$E$2828)
This should return the item from Column E that is either at or above the same row as myDate in Column A. If myDate does not exist in column A, it will match the nearest earlier date in Column A and return from that row in Column E.
In the second version of the formula, it also checks that there is an entry in Column E matching the column A date, and, if not, it will look above.
I have: =NETWORKDAYS(N25, AJ25-1) in Column O to calculate the number of busines days since an item has gone out of the building. right now I am manually duplicating it each time a new item goes out.
But is there a way to put a formula that when Column N is filled out, it will automatically added in the formula above in Column O respective to the row?
On that note, it seems my formula is a bit wonky. It works perfectly when it gets to the day AFTER it was sent out (day 1), but if it's sent out today, it will come back with the value -1 or -2 instead of "0" indicating that today's date (AJ25) is the same as the value I entered in on Column N.
I can understand why it does that but not sure how to calculate it so it doens't count today's date but starts the day after.
It seems #Jeeped's formula met the requirement:
=if(isblank($N25), "", NETWORKDAYS(N25, MAX(N25, AJ25))-1)
I have an Excel spreadsheet like so:
A B
27/03/2015 Riddor
28/03/2015 Text
09/03/2015 Bees
What I am trying to do is search my column B for the word Riddor using this function:
=IF(ISERROR(MATCH("Riddor",Statistics!B:B,0)),"No Match",TODAY()-MIN(Statistics!B:B))
Within this function if the value Riddor is not found I want to show 'no match' else if the value is found I want to identify the most recent occurrence of the value Riddor in my column where its date in column A is the most recent from today. I then want to count the number of days.
So for instance my value Riddor in column B has a date of 27/03/2015. The number of days from this date to today is 5, however if I add another Riddor with a more recent date like so:
27/03/2015
31/03/2015
then I want my day count to show 1 day instead of the previous 5 days.
Can someone please show me where I am going wrong and what to do to get this working?
You will need to use a formula as defined below
Note that the flower brackets indicate that you are using this as a range formula which means you will need to hit Shift+Control+Enter and when you click on that Cell it will create the flower brackets in the end.
The below formula will retrieve the MAX Date the next part is quite simple you need to subtract from today to arrive at the difference in days. Preferably do it in another cell. I have accounted for different sheets in a modified formula at the bottom of this post. But you can test the below on the same sheet and then copy over the cell to another sheet to have it dynamically correct to account for sheet if you like. Either ways the below is tested with all events and is working
{=IF(COUNTIF(B:B,"Riddor")=0,"No Match",IF(COUNTIF(B:B,"Riddor")=1,INDIRECT("A"&MATCH("Riddor",B:B,0)),MAX(IF(B:B="Riddor",A:A))))}
Explanation
Part I - =IF(COUNTIF(B:B,"Riddor")=0,"No Match" Counts if there are any occurance of the word Riddor in that Range
Part II - IF(COUNTIF(B:B,"Riddor")=1,INDIRECT("A"&MATCH("Riddor",B:B,0)) this part accounts if there is only once occurance of the word Riddor then it uses the Match function to retrieve the date from the A Column. It would be easier with VLOOKUP but I'm assuming you dont want to change the Column Order for A & B
Part III - MAX(IF(B:B="Riddor",A:A)))) This where the Range formula is actually required. It checks in the Range B:B and Retrieves all the Dates where the B Column Matches "Riddor" and then Finds the Max date in that subset Range which would be the date closest to today's date.
Tested and Working perfectly in sample provided by your even with Multiple instances of Riddor.
Formula Accounting for the difference in Sheets not tested yet.
{=IF(COUNTIF(Statistics!B:B,"Riddor")=0,"No Match",IF(COUNTIF(Statistics!B:B,"Riddor")=1,INDIRECT("Statistics!A"&MATCH("Riddor",Statistics!B:B,0)),MAX(IF(Statistics!B:B="Riddor",Statistics!A:A))))}
I have an Excel 2010 workbook with this formula:
=EOMONTH("01"&TEXT(B7,"MMM")&IF(MONTH(CMVAR)<4,TEXT(YEAR(CMVAR)-1,"YYYY"),TEXT(YEAR(CMVAR),"YYYY")),0)
It resolves when you are in the cell and press Enter, however when the workbook first opens or is refreshed, the result is #VALUE!. Here are the components:
B7 =IF(OR(MONTH(CMVAR)>6,MONTH(CMVAR)<4),"Apr",IF(MONTH(CMVAR)=4,TEXT(EDATE(CMVAR,-3),"MMM"),IF(MONTH(CMVAR)=5,TEXT(EDATE(CMVAR,-3),"MMM"),TEXT(EDATE(CMVAR,-3),"MMM"))))
which equates to Apr.
CMVAR 31/03/2015
The formula is being used because in April, May, June (first three fiscal periods) we require comparison data to show in the 12-period grid from the previous financial year. From July onwards we will have comparable data from the current year and so the grid can start from April. Once the month has been determined I'm trying to work out what the date of the end of that period is, taking into account that Jan, Feb and Mar are actually periods 10, 11 and 12 of the fiscal year and so the year element of the formula will be the prior year if CMVAR shows the date to be in any of those months.
Is there a better way that avoids the error or a way to fix it?
It is not completely clear what result do you expect for different values of CMVAR, but looking at your formula, I suppose you want it to be:
You can calculate Result with the following formula:
=EOMONTH(CMVAR,-MAX(MOD(MONTH(CMVAR)-4,12),3))
If the picture above does not show your expected output, can you please prepare similar table?
EDIT:
To explain how the problem is solved, I have created additional columns with intermediate calculations:
column C is the month difference between CMVAR and expected result - the goal is to find a formula returning this number
column D calculates month of CMVAR
column E - function MOD returns the remainder after number is divided by divisor (12).
column E matches all values of C, except 0,1,2, so in column F function MAX replaces those values with 3
Your EOMONTH formula is going wrong because the TEXT part should be in the form TEXT(date,"YYYY"). YEAR(CMVAR) gives a number rather than a date.
You could use instead
=EOMONTH("01"&TEXT(B7,"MMM")&IF(MONTH(CMVAR)<4,TEXT(EDATE(CMVAR,-12),"YYYY"),TEXT(CMVAR"YYYY")),0)
or this may be easier than using the TEXT functions
=EOMONTH("01"&B7&IF(MONTH(CMVAR)<4,YEAR(CMVAR)-1,YEAR(CMVAR)),0)
Your B7 formula is OK but could be simplified to
=IF(OR(MONTH(CMVAR)>6,MONTH(CMVAR)<4),"Apr",TEXT(EDATE(CMVAR,-3),"MMM"))