Purely excel formula with network days - excel

I have this spreadsheet to track how long a team is taking to complete customer requests. I've coded the net days considering holidays and work week for different team members but when 'L2' is blank (case completed date) my formula is returning odd values such as '30520'
I want to tell excel that is L2 is blank, then ignore my formula and leave the cell blank, else display the calculated value. I am also okay with displaying OPEN if L2 is found empty. This is what my formula looks like:
=IF(OR(B2="Jack", B2="Jill"),NETWORKDAYS.INTL(K2,L2,1,O$2:O$11),
NETWORKDAYS.INTL(K2,L2,7,Q$2:Q$26))
Where:
B2 = case owner
K2= case received date
L2 = case completed date
O = set of US holidays
Q = set of intl’ holidays
Thanks!

I want to tell excel that is L2 is blank, then ignore my formula and leave the cell blank
Well, that's easy enough to do with just any formula: Wrap another IF statement around the formula
=if(L2="","",<theFormula>)

I got the answer to this in a different forum. I used the following:
=IF(L2="","OPEN",IF(OR(B2="Jack", B2="Jill"),NETWORKDAYS.INTL(K2,L2,1,O$2:O$11),NETWORKDAYS.INTL(K2,L2,7,Q$2:Q$26)))
Also, I formatted my target cell as "general" and it worked wonders!

Related

Countif function for multiple criteria

I am trying to create a formula in Excel that will count cells with 3 certain criteria. My example is below: cell M3:M350 is the name, cell Q3:Q350 is the date, cell R3:R350 is the current step. I need to know how many times the name Amanda shows up that is in the current step of Material Review, and that is also 30 days or less than the date in cell Q3:Q350. The formula I have been trying is:
=COUNTIFS('Active Projects'!M3:M350,"AMANDA MARTIN",'Active
Projects'!Q3:Q350,"<="&NOW+30,'Active Projects'!R3:R350,"*MATERIAL REVIEW")
The answer keeps giving me 0, and it should be 1.
Does anybody know the correct formula to use? It has been eating at me for a week now, and I have tried different variations, and still cannot get it to not count the dates older than 30 days from today.
please update your formula as follows:
=COUNTIFS('Active Projects'!M3:M350,"AMANDA MARTIN",'Active Projects'!Q3:Q350,"<=" & TODAY() + 30,'Active Projects'!R3:R350,"*MATERIAL REVIEW")
Structure you have used for date is not correct:
=COUNTIFS('Active Projects'!M3:M350,"AMANDA MARTIN",**'Active
Projects'!Q3:Q350,"<="&NOW+30**,'Active Projects'!R3:R350,"*MATERIAL REVIEW")
there should be brackets () after NOW or TODAY functions.

Excel formula help - return a value based on two conditions

Forgive me as I'm a bit of a novice with Excel and have no idea if this is possible or not. Looking for a formula to return one of four values, based on two criteria. One is a Drop-down list with either "Sun-Sat" or "Thur-Wed" options, and the other is a date value. If the date entered falls on a Monday or Tuesday it should return one value, and if the date entered falls on a Wednesday/Thursday/Friday it should return another.
A B
Sun-Sat Thurs-Wed
1 Monday/Tuesday 28/06/2015 25/06/2015
2 Wednesday/Thursday/Friday 5/07/2015 2/07/2015
Drop down box is cell B6 and Date is cell A6
I hope that is enough detail, any help is greatly appreciated!
Say you have these on the "Match" sheet:
A B C
1 Sun-Sat Thurs-Wed
2 Monday/Tuesday 28/06/2015 25/06/2015
3 Wednesday/Thursday/Friday 5/07/2015 2/07/2015
And say you keep the first criterion(Match!$A) in A2 and the second (Match!$1) in B2.
The formula you'll need is:
=INDEX(Match!$1:$1048576;MATCH($A2;Match!$A:$A;0);MATCH($B2;Match!$1:$1;0))
The MATCH() formulae provides the indices that the INDEX() formula uses to identify the output cell.
As pnuts have highlighted I missed that it was one date and one validation.
=INDEX(Match!$1:$1048576;MATCH(IF(OR(WEEKDAY($A6)=2;WEEKDAY($A6)=3);"Monday/Tuesday";"Wednesday/Thursday/Friday");Match!$A:$A;0);MATCH($B6;Match!$1:$1;0))
is an augmented version for when the A column contains dates. Note: I treated the two sets as alternatives, the weekends will be wrongly classified if existent.
Edit not from answerer - layout might be closer to OP's, with formula adjusted to suit (also shows results from various inputs):

Subtraction with blank cells - Excel

I created spreadsheet for budgeting purposes and have it set up so that every time I add some data in my income or expenses column, my balance column automatically posts a readjusted value. However, my formula only seems to work for positive values (see conflict on row 4 of example) Here's what I have so far, pasted in as an array formula in B3 and copied down.
=IF((ISNUMBER(C3:D3)),B2+C3-D3,"")
How could improve the "if true" section of my formula?
the problem you're having is your if statement will return false if either C or D is not a number. if(c through d is a number) will mean that it only is true when both are numbers.
If you want to make it so that you only evaluate numbers (and not treat blanks as 0), then you'll probably want to make an OR statement:
=IF(OR(ISNUMBER(C3),ISNUMBER(D3)),B2+C3-D3,"")
Just be aware that if the relative location of B2 is missing data (if you did not have any expense or income the previous day/week/whatever), then the next field will become a value error when you add something. So if B5 is empty because you didn't do any spending or gaining, then when you spend and put value in "expense" on D6, B6 will become #Value.
To fix this, it might be a good idea to finish off not with an empty string, but with the value of the previous date. It's up to you if you want to use it that way.
=IF(OR(ISNUMBER(C3),ISNUMBER(D3)),B2+C3-D3,B2)
You could try the following, applied on B3:
=IF(AND(ISBLANK(C3),ISBLANK(D3)),"",B2+C3-D3)
This way, you don't need an array formula - I'm just checking if C3 AND D3 are blank - if so, the cell will be empty, otherwise will do the math.
You could put an Or statement in so that if either C3 or D3 is a number, then calculate accordingly.
=IF(Or(ISNUMBER(C3),ISNUMBER(D3)),B2+C3-D3,"")

MS Excel: Count frequency of similar values in between blank cells

I'd like the count the frequency of identical values in a row. The value must occupy at least two cells and must be beside each other.
I'd like to post the image here but i do not have enough reputations. Anyway, screenshot can be found here: https://www.dropbox.com/s/1em9ltssc1ruw0u/stackOverflow_excelIssue_Countfrequencyofsimilarvaluesinbetweenblankcells.jpg?dl=0
J7:BE7 is where a person will type in the values - it correspond to time, in 30mins increment.
On a different part of the same sheet, in this case DD7:EY7 is where i have the formulas running.
This formula is on (first column) DD7 -- COUNTIF(J7:$BE7,J7)
This formula is on (last column) EY7 -- COUNTIF(BE7:$BE7,BE7)
The formula on DD7 counts the number of times the value on J7 appears across row 7 from column J to BE.
scenario 1: This formula works great if "orange" will only appear once. on my example from K7:L7.
scenario 2: The problem is when "orange" appears again on a non consecutive cell. what i mean is, "orange" appears on K7:L7, then it appears again on P7:Q7.
on scenario 1, the result of the formula in checking K7:L7 is 2, which is the desired value.
on scenario 2, the result of the formula in checking K7:L7 is 4, because it will also count "orange" that appears on K7:L7.
I was hoping the counting will stop if M7 has a different value. K7:L7 contains "orange" and M7:N7 has "apple". or the counting will stop if there's an empty cell in between, like U7:V7 contains "guava", and T7 is empty, then X7:Y7 again has "guava".
the fruits may occupy two to forty-eight columns of each row.
I know this is wordy, but i can't find other ways to explain it, english is not my first tongue.
Thank you in advanced.
~mark
I agree that the question could have been worded a little better, but I think I understand what you're looking for. I can't think of a good way to do it with built-in Excel functions, but if you're willing to make a little use of VBA, you can make a custom function that you can use just like it was a normal function in Excel. You'd just need to add something like this into a new module:
Public Function NumInARow(r As Range) As Variant
Dim i As Integer
If r.Value = "" Or r.Value = Empty Then
NumInARow = ""
Exit Function
End If
If r.Column > 1 Then
If r.Offset(0, -1).Value = r.Value Then
NumInARow = ""
Exit Function
End If
End If
i = 1
Do While r.Offset(0, i).Value = r.Value
i = i + 1
Loop
NumInARow = i
End Function
This function looks at the cell you pass as a parameter, and looks at the cells to the right until it finds a different one and counts the number of identical cells it comes across. For example, if cells A1-C1 all say "Bob" and D1 is blank or has a different value, then if you put =NumInARow(A1) in cell A2, then A2 would show a value of 3. You could drag that formula along the whole cell. The formula leaves the cell blank if the cell it's looking at is not the first in a sequence or if the cell it's looking at is blank. For example, if you put =NumInARow(B1) into cell B2 from the above scenario, B2 would appear blank because the second "Bob" was not the first in the sequence. I hope someone else can think of a way to do this with built-in Excel functions, but this may be an option for you. Here's a WikiHow article to show you how to make/where to put user-defined functions. It's pretty simple if you already have the code.
http://www.wikihow.com/Create-a-User-Defined-Function-in-Microsoft-Excel
The answer which I accepted - using formula - is from G-Man of superuser.com
The thread can be found on this link:
MS Excel: Count frequency of similar values in between blank cells
https://superuser.com/questions/806427/ms-excel-count-frequency-of-similar-values-in-between-blank-cells
This is verbatim of his words:
If I understand your request correctly, the following formulas will work. My solution requires a dummy column and a helper row, but they can be hidden. Further, you can probably eliminate the dummy column with a little bit of work, and you can put the helper row anywhere.
I’ll assume that your client names are in row 2. I’ll use column A as the dummy column, so the appointment data start in column B. Row 3 will be the helper row. In cell B3, enter the formula:
=IF(B2="", "", IF(B2<>C2, 1, C3+1))
Meaning:
If B2="", the client name for this timeslot is blank, so this is an idle timeslot, so display blank.
Otherwise, if B2<>C2, this timeslot and the next have different clients (C2 may or may not be blank), so this is the last timeslot for this appointment. Represent it as 1. Otherwise, count backwards, so the second-to-last timeslot for this appointment is 2, the third-to-last timeslot is 3, etc.
In cell B4, enter:
=IF(A2<>B2, B3, "")
If A2<>B2, this timeslot and the previous one have different clients (A2 may or may not be blank), so this is the first timeslot for this appointment. Display B3, which shows how many timeslots (half hours) there are in this appointment. Otherwise, display blank.
you can find more of his answers on the link I have provided.
Thank you for everyone's help.
Best Regards,
~mark

IF formula to compare a date with current date and return result

I'm looking for a formula which allows me to look at a cell and check if it greater than or equal to today's date and to return a worded result such as "overdue". If it is blank to return another word, or nothing.
I have tried copying the result from the source cell (O10) into another cell (Y10) and used an if statement but this seems overly laborious - there must be a way to read the information from the source cell? See below. It also returns overdue when the cell is blank :(
=IF(O10>Y10,"OVERDUE","NOT DUE")
You can enter the following formula in the cell where you want to see the Overdue or Not due result:
=IF(ISBLANK(O10),"",IF(O10<TODAY(),"Overdue","Not due"))
This formula first tests if the source cell is blank. If it is, then the result cell will be filled with the empty string. If the source is not blank, then the formula tests if the date in the source cell is before the current day. If it is, then the value is set to Overdue, otherwise it is set to Not due.
I think this will cover any possible scenario for what is in O10:
=IF(ISBLANK(O10),"",IF(O10<TODAY(),IF(TODAY()-O10<>1,CONCATENATE("Due in ",TEXT(TODAY()-O10,"d")," days"),CONCATENATE("Due in ",TEXT(TODAY()-O10,"d")," day")),IF(O10=TODAY(),"Due Today","Overdue")))
For Dates that are before Today, it will tell you how many days the item is due in. If O10 = Today then it will say "Due Today". Anything past Today and it will read overdue. Lastly, if it is blank, the cell will also appear blank. Let me know what you think!
The formula provided by Blake doesn't seem to work for me. For past dates it returns due in xx days and for future dates, it returns overdue. Also, it will only return 15 days overdue, when it could actually be 30, 60 90+.
I created this, which seems to work and provides 'Due in xx days', 'Overdue xx days' and 'Due Today'.
=IF(ISBLANK(O10),"",IF(DAYS(TODAY(),O10)<0,CONCATENATE("Due in ",-DAYS(TODAY(),O10)," Days"),IF(DAYS(TODAY(),O10)>0,CONCATENATE("Overdue ",DAYS(TODAY(),O10)," Days"),"Due Today")))

Resources