select data of one column on basis on another column in excel - excel

I am trying to create an excel sheet in which I have one column which stores the date of a software release and just right to it is stored whether that release rejected in the form of yes or no. something like this:
Release Date Rejected
25/01/2015 No
26/02/2015 No
30/03/2015 No
01/05/2015 Yes
With this I am maintaining another table in same sheet which gives total number of releases and rejected releases till a particular month something like this:
Year = 2015 No. of release No of rejected release
Month Till month IN month Till month IN month
January 1 1
February 2 1
March 3 1
April 3 0
May 4 1
If you see in result table, no of release till MAY are 4 and in the month of may it is only one. This I am doing by comparing all dates in "release date" column with 31/05/2015 and counting all dates before that.
Similarly I want to do for number of rejected release. for example for month of May, count all release dates before 31/05/2015 and then from that count only those release which are rejected on basis of yes or no.
Can anyone please help as I am not able to figure out the formula for this.

Related

Excel - Count the number of instances of order status

I have the above sales order data which lists a day by day update of orders as they go through each stage until shipped. Orders 1 and 2 are shown alongside the status of that order for each date between 1st and 08th February.
What I need to do (in a pivot eventually), is to count the number of days for each order that they were in each state. So for example Sales number 1 was in a processing state for 4 days and a packed state for 3 days and then finally a shipped state for 1 day. I want these 3 numbers displayed beside each status maybe on a separate line?
For example
Sales Number 1
Processing - 4 Days
Packed - 3 Days
Shipped - 1 Day
You'll also notice that on Sales Number 2, the order went back into a "On Hold" state, this can occur in my dataset so just count it as normal e.g On Hold - 2 days.
How would I get this count using a formula or pivot etc?
Simplest way is to use pivot table:

How to Perform Column-Wise Logical Operations in Excel

I'm working with an Excel sheet of customers, a snippet of which looks like this:
Name
Month
Contacted?
Bob
January
Yes
Sally
January
Yes
Smith
January
No
Alice
March
No
Peter
May
Yes
I'm trying to get a count of the customers in each month that have been contacted and those in each month that haven't been contacted. I've been able to get a count of the number of customers in each month by doing =SUMPRODUCT(B2:B5="January") and a count of how many customers have been contacted with =SUMPRODUCT(C2:C5="Yes"). It feels like there should be a way to perform column-wise logical operation, like this: =SUMPRODUCT(AND(B2:B5="January", C2:C5="Yes")) to get a count of the number of customers that were contacted in January, but that doesn't work.
The end table that I'm trying to generate would look like this, where any edits to the above table should update this one:
Month
Total Customers
Contacted Customers
Non-Contacted Customers
January
3
2
1
March
1
0
1
May
1
1
0
What's the right way to implement these formulas?
Where your Data is in Column A to C and your Table Starts at Column E

Excel Date difference without weekend days

Last time I posted a quite vague story about a date difference challenge which I haven't solved yet. I will try to elaborate since I have tried everything in my power and the problem still isn't fixed.
I currently have three columns.
Column 1 (F)
the date a car starts its repairs (format DayOfWeek-DD-MM-YYYY)
Column 2 (G)
the number of days in which the car is repaired (service level agreement [SLA]; the standard is 10 days)
Column 3 (H)
the output, which is the date the car should be finished. So the number of days after the startdate*
*Th thing which makes this case difficult is that only weekdays are included.
So, for example:
If a car starts repairs on Monday 1st of August, the finish date is Tuesday the 14th of August.
I tried to solve this with the following formula:
=IF(WEEKDAY(F218)=2;(F218+11);
IF(WEEKDAY(F218)=3;F218+12;
IF(WEEKDAY(F218)=4;F218+13;
IF(WEEKDAY(F218)=5;F218+14;
IF(WEEKDAY(F218)=6;F218+15)))))
In other words:
If startdate = Monday then startdate + 11,
if startdate = Tuesday then startdate + 12, etc.
This works, but I have 300+ rows and dragging this function down doesn't change the cell references.
I know about the NETWORKDAYS and WEEKDAY functions, but I encounter problems with any Monday where only 1 weekend passes and other days where 2 weekends pass.
First of all, I am assuming that your first day - whatever day that may be - is considered day one (1). So in my scenario, if a SLA states 2 days to complete a repair and the start date is a Monday, I'm assuming the repair should be completed by Tuesday.
My assumption is based off this comment by #RonRosenfeld:
...although you might have to subtract 1 from the number of days
With all that being said, try this formula in your cell instead:
 NOTE: You may need to change things like commas and semi-colons to adjust for your region.
=WORKDAY($F2,$G2-1)+LOOKUP(WEEKDAY(WORKDAY($F2,$G2-1),16),{1;2;3},{2;1;0})
What it does:
WORKDAY($F2,$G2-1)
First we want to find out exactly what day the repairs should be completed by if weekend days (Saturday and Sunday) were included. This part of the formula will simply give us a place to start.
$F2 is your repair start date
$G2 is the number of days a repair is supposed to take (you may need to add a column for this, because, as you stated, the SLA may change and you need the formula to be easily adjusted)
WEEKDAY(WORKDAY($F2,$G2-1),16)
The WORKDAY function from above is wrapped inside a WEEKDAY function. This WEEKDAY function is written to account for each day of a week to be assigned numbers. The [return_type] parameter of 16 tells Excel to label them as "Numbers 1 (Saturday) through 7 (Friday)". We chose 16 so that our LOOKUP function is easier to write. This part of the formula only returns a one-digit number, which in turn will be used to figure out what day of the week we actually want when excluding weekends.
LOOKUP(WEEKDAY(WORKDAY($F2,$G2-1),16),{1;2;3},{2;1;0})
We finish the formula by adding the result from a LOOKUP function using the first form of the function: LOOKUP(lookup_value,lookup_vector,[result_vector])
We found our lookup_value in the previous bullet point using the WEEKDAY function. Now we want Excel to use the lookup_vector - {1;2;3} in our formula - to find the correct value to add to the first part of our formula (which is found using the [result_vector] - {2;1;0} in our formula).
The lookup_vector only has three values: 1, 2, and 3.
1 signals Saturday
2 signals Sunday
3 signals all other days
Think of the lookup_vector and [result_vector] as forming a matrix/table from which our value is found:
1   2
2   1
3   0
If our number of repair days pushes us to:
a Saturday (1), the formula adds 2.
a Sunday (2), the formula adds 1.
any weekday, the formula adds 0 (since weekdays are acceptable).
Hopefully all of this makes sense. Best of luck to you!

CountIfs with Multiple Criteria?

I have a table like this:
Date Paid Days Late Date Paid Days Late Date Paid Days Late Date Paid Days Late Date Paid Days Late Date Paid Days Late
Utilities Admin Utilities Admin Utilities Admin
Company January January January January February February February February March March March March
Wayne Enterprises 2/15/2016 5 10-Feb 0 3/11/2016 1 4/15/2016 5 4/25/2016 15
Stark Industries 2/12/2016 3 2/8/2016 0 3/19/2016 10 3/8/2016 0 4/15/2016 5 4/1/2016 0
(I suggest though looking at the screenshot to see how it's laid out, as the pasting into here isn't very pretty, any tips? Here's a link to this on Google Spreadsheets).
How can I, in N4, create a formula that will count the number of months what have a late report (defined as any "Days Late" over 0). Obviously, I can do this:
=COUNTIFS(B1:M1,"Days Late",B4:M4,">0"), which returns 4.
For Wayne Enterprises, in March, both Utilities and Admin were paid late. However, this should only count as 1 month. How can I somehow add to my CountIfs() a statement that is like "if two values in the same month are greater than 0, treat as ONE month"?
I tried also doing something like:
=COUNTIFS(B1:M1,"Days Late",B4:M4,">0")/COUNTIFS(B1:M1,"Days Late",B4:M4,">0")+1
But that doesn't quite do the trick either. Thanks for any ideas. (Of course, if CountIfs() isn't the best way, I'm open to any other formulas! I have a sneaking suspicion SumProduct() might be an alternative) I'd prefer a formula solution over VBA, but if absolutely necessary, we can do a UDF perhaps.
Edit: I could create yet another helper column that compares a single month's Utilities and Admin, and if one or both are late, put 1, then just Countif() that column has 1 in it...but I'd rather not keep creating columns if I can help it, as I'll be doing this for 12 months.
Use this Array formula:
=SUM(IF(($B4:$M4>0)*($B$1:$M$1="Days Late"),1/COUNTIFS($B$3:$M$3,$B$3:$M$3,$B4:$M4,">0",$B$1:$M$1,"Days Late")))
Being an array formula it must be confirmed with Ctrl-Shift-Enter when exiting edit mode. If done properly excel will put {} around the formula.
As per your new data use this:
=SUM(IF(($B5:$BI5>0)*($B$1:$BI$1="Days past 10th of Following Month"),1/COUNTIFS($B$3:$BI$3,$B$3:$BI$3,$B5:$BI5,">0",$B$1:$BI$1,"Days past 10th of Following Month")))
The helper row of months in row 4 is not needed.
EDIT #2
My bad I forgot that when using formulas that return "" will cause an error so lets put in a check for that:
=SUM(IF(($B5:$BI5<>"")*($B5:$BI5>0)*($B$1:$BI$1=$AS$1),1/COUNTIFS($B$3:$BI$3,$B$3:$BI$3,$B5:$BI5,">0",$B$1:$BI$1,$AS$1)))

Excel Date Formula (Closest date of a list to =today() showing up)

I'm trying to create this formula, but i need some help:
I have a list of dates in excel, that basically announce the days we receive a report from a source that we have to send to the final client 3 days after we receive it:
Source 1 - 23/03/15
Source 2 - 24/03/15
Source 3 - 02/04/15
Client - (3 days after receiving a source)
So basically, for source we have a different final client delivery.
But to avoid creating 3 other cells, i would like to do a formula.
Basically the date that should show up in client cell, would be the one more close to =today() and than we would add + 3 days to it. if all dates already passed the =today() would appear ND.
What i having troubles it's to put in formulas "closest date of this list to =today()".
Thank you all.
I think a formula such as:
=IF(MIN(A:A)<today(),"ND",MIN(A:A)+3)
may suit, thought this is assuming 'deadlines' are never missed. So on the day of posing (March 5) the first delivery should be March 26 (depending on the exact interpretation of 3 days after) since the earliest known receipt date is March 23. On say March 25 the formula result would be "ND" since there would not then be three days between earliest receipt and know delivery requirement. However if the earliest two dates are deleted, the latest (only) remaining receipt date that day would be April 2 and the formula return April 5. No other changes and the formula would, given time, return "ND".

Resources