I am creating an excel worksheet to summarise values in another worksheet. The problem is that I have many different customer ID's and every six month period we receive a summary of their activities on their phone. One column shows whether they have updated to the new OS. It shows a 0 if they haven't and a 1 if they have done it in that 6 month period or prior to that six month period.
I have already tried playing around with IFERROR and INDEX formulas, but these haven't worked for me.
I really haven't been able to get this to work at all, so I don't have any code to show you. However this is the general format of the data.
In column A you have all the customer ID's and there are multiple entries for each 6 month period. Then in column B you have the date of the 6 month entry, and in Column C a 0 or 1 according to if they haven't or have updated yet respectively.
+-------------+--------+----------+
| Customer ID | Date | Updated? |
+-------------+--------+----------+
| 001 | Dec-17 | 0 |
| 001 | Jun-17 | 0 |
| 001 | Dec-16 | 0 |
| 001 | Jun-16 | 0 |
| 002 | Dec-17 | 1 |
| 002 | Jun-17 | 1 |
| 002 | Dec-16 | 0 |
| 003 | Dec-17 | 1 |
| 003 | Jun-17 | 1 |
| 003 | Dec-16 | 1 |
| 003 | Jun-16 | 0 |
| 003 | Dec-15 | 0 |
+-------------+--------+----------+
The output should be in a separate tab which only has the unique Customer IDs and look like this:
+-------------+--------------+
| Customer ID | Date Updated |
+-------------+--------------+
| 001 | 0 |
| 002 | Jun-17 |
| 003 | Dec-16 |
+-------------+--------------+
I think it will require array formulas, but don't really know how these work.
Any help would be greatly appreciated.
Assuming that the dates are real dates, not text:
If you have Office 365 you can use Minifs
=MINIFS(Table1[month],Table1[id],F5,Table1[value],1)
If you don't have that function, you can use this array formula:
=MIN(IF((Table1[id]=F5)*(Table1[value]=1),Table1[month]))
Remember to confirm with Ctrl+Shift+Enter.
Format the result with custom format mmm-yy;;0 which shows 0 for 0 values, not dates.
Adjust the formulas accordingly, if you want to place them on a different sheet.
Edit after comment: The formulas I posted use structured referencing to the Excel Table. If your data is not in a Table Object or you don't want to use structured references, you can use regular references, of course.
=MINIFS($C$5:$C$16,$B$5:$B$16,F5,$D$5:$D$16,1)
or
=MIN(IF(($B$5:$B$16=F5)*($D$5:$D$16=1),$C$5:$C$16))
Related
I am currently working in Excel but I am willing to consider solutions in (free) database software. The data I have is organized by time period, one worksheet for each period. The worksheets all have the same column structure.
Here is an example of the data from the 2017-Q1 worksheet:
| Time Period | Product ID | Prod. Category ID | Product Scale |
| 2017 - Q1 | 0012345678 | 012345 | 3 |
| 2017 - Q1 | 0023456789 | 012345 | 1 |
| 2017 - Q1 | 0033333588 | 022235 | 3 |
| 2017 - Q1 | 0123333333 | 022235 | 1 |
Here is an example of the data from the 2017-Q2 worksheet:
| Time Period | Product ID | Prod. Category ID | Product Scale |
| 2017 - Q2 | 0012345678 | 012345 | 5 |
| 2017 - Q2 | 0033333588 | 022235 | 7 |
| 2017 - Q2 | 0123333333 | 025444 | 5 |
| 2017 - Q2 | 0145555578 | 025444 | 1 |
The things that I am particularly focused on are:
Product ID 0023456789 does not appear in 2017-Q2, so the corresponding column in the master worksheet should show something (it could be blank, it could be NULL, it could be N/A, it doesn't matter as long as it is always the same.) The same thing needs to happen when a Product ID first appears in a later time period, the time periods before that should have the same N/A (or NULL, or blank, or whatever) This means that in order to form the master worksheet, I need to make a consolidated list of all of the Product IDs from all of the time periods, since not all of the Product IDs are present in every time period.
Product ID 0123333333 changed Prod. Category ID, so I need to always pull at least the Prod. Category ID column and the Product Scale column for each time period, just to be sure if it has changed or not.
I want to generate a master worksheet as follows (abbreviating column names just for space constraints here in this website):
| Product ID | 2017-Q1PCID | 2017-Q1 PS | 2017-Q2 PCID | 2017-Q2 PS |
| 0012345678 | 012345 | 3 | 012345 | 5 |
| 0023456789 | 012345 | 1 | N/A | N/A |
| 0033333588 | 022235 | 3 | 022235 | 7 |
| 0123333333 | 022235 | 1 | 025444 | 5 |
| 0145555578 | N/A | N/A | 025444 | 1 |
I have 12 different time period worksheets, so the master worksheet would need to first make a master list of unique Product IDs and then have 24 additional columns, because there are 2 columns for each time period (one column for the Product Category ID and another for the Product Scale ID, for that time period.) Furthermore, I should mention that each time period worksheet has 8,000-12,000 Product ID records, so ideally the solution should be able to handle thousands of rows fairly quickly.
TLDR : use index() match() .
Assuming the table 1 is located at "Sheet1" and the "Product ID" in the last table is located in cell A1, put this in B2 :
=IFERROR(INDEX('2017-Q1'!C:C,MATCH(A2,'2017-Q1'!B:B,0)),"")
and in C2 :
=IFERROR(INDEX('2017-Q1'!D:D,MATCH(A2,'2017-Q1'!B:B,0)),"")
and drag downwards.
Idea : 'load' the answer if the Product ID is matched in the source sheet, and put blank if no Product ID match is found.
Hope it helps. (:
I have a large data set that contains details about objects that are currently on an extension. The extensions are given a specific due date. Some of the extensions are past their due date.
I'm struggling to work out how to create a column in PowerPivot for O365 Excel that will return a yes/no value depending on if the object is one of the 5 most overdue extensions. So far nothing I've tried has worked at all.
Example with fake data:
+-----------+---------+--------------------+------------+
| ID | Urgency | Bus Days Remaining | Due Date |
+-----------+---------+--------------------+------------+
| 118017544 | Overdue | -487 | 1/04/2017 |
| 34960939 | Overdue | -97 | 30/09/2018 |
| 10695082 | Overdue | -364 | 20/09/2017 |
| 166236826 | Overdue | -86 | 15/10/2018 |
| 166236826 | Overdue | -86 | 15/10/2018 |
| 34944450 | Overdue | -437 | 9/06/2017 |
| 69427293 | Overdue | -446 | 29/05/2017 |
| 56280961 | Overdue | -437 | 9/06/2017 |
| 12535364 | Overdue | -176 | 11/06/2018 |
| 46296100 | Overdue | -163 | 28/06/2018 |
| 171666963 | Overdue | -122 | 24/08/2018 |
+-----------+---------+--------------------+------------+
The calculated column should be able to put a "Yes" next to 5 rows in this data that are the oldest.
Factors that might be important:
Multiple extensions can share a due date but be separate extensions. This makes me think that the formula needs to be based off of the "Bus Days Remaining" column value
Excel has a function in Pivot Tables where you only show the Top 10 values. This isn't an option for me because using that filter means you cannot drill into the Pivot Tables data.
Any help you could provide would be great :)
Thanks in advance
Please try this formula.
=C2<=SMALL(C$2:C$12,5)
If the 5th and 6th smallest are equal the formula will return TRUE for more than 5 items.
Within a resource planner, my data has a row for each employee, and columns detailing the team they work for. Another column details the available days they will work in the year. The teams are also displayed along a row at the top, see below :
A | B | C | D | E | F | G |
1 Employee | Team 1 | Team 2 | Days | Finance | Risk | IT |
2 Employee 1 | Finance | | 170 | | | |
3 Employee 2 | Risk | Finance | 170 | | | |
4 Employee 3 | Finance | | 170 | | | |
5 Employee 4 | IT | Risk | 170 | | | |
6 Employee 5 | IT | Finance | 170 | | | |
I want to use columns E:G as a supply calculator per team. Therefore, the formula in cell E2 would be "=IF(B2=E1,D2,0)" and copied along the row, returning the 170 days under Finance and 0 under the rest.
The issue lies where an employee divides his time between two different teams. As you can see, some employees can work for 2 different teams (Employee 2 works for both Finance and Risk, for example). The formula in E3 would therefore need to be some kind of IF AND, where if a value is present in the Team 2 column (C), the value in the Days column (D) would be divided by two and split across the relevent team columns.
I've tried a few options, IF AND, nested IFS etc but cant seem to get the syntax correct. Any help greatly appreciated.
=IF(ISNUMBER(MATCH(E$1,$B2:$C2,0)),$D2/COUNTA($B2:$C2),0)
You actually want OR and COUNTA:
=IF(OR($B2=E$1,$C2=E$1),$D2/COUNTA($B2:$C2),0)
I have sales data by customer as follows:
| - | A | B | C | D | E | F | G |
|---|---------------|--------|--------|--------|--------|--------|--------|
| 1 | Customer Name | Jan-18 | Feb-18 | Mar-18 | Apr-18 | May-18 | Jun-18 |
| 2 | Mr.A | 1000 | 500 | 0 | 200 | 0 | 0 |
| 3 | Mr.B | 0 | 300 | 200 | 0 | 0 | 100 |
I need the formula to know the last sales of the respective customer booked (the name of the month)
in this case, Mr. A last order is in Apr-18 while Mr.B is in Jun-18.
I have 2,000 plus customer and sales data since Apr 2016 up to last month, it will be a huge time saving to have a formula to help.
Assuming your 'months' are dates, not Text. Courtesy #barry houdini:
=LOOKUP(2,1/(B2:G2<>0),B$1:G$1)
in Row2 and copied down to suit, formatted mmm-yy.
Ref
An alternative to using LOOKUP() as in this answer, not sure what impact it has performance-wise as both need to create an array but I would take a stab in the dark that this is less performant:
=INDEX($B$1:$G$1,,MAX((B2:G2<>0)*COLUMN(B2:G2)-1)) - Ctrl+Shift+Enter
Ofcourse this could be edited to a dual lookup on the customer too:
=INDEX($B$1:$G$1,,MAX(INDEX(($B$2:$G$3<>0)*COLUMN($B$2:$G$3)-1,MATCH("Mr.B",$A$2:$A$3,0),0)))
This doesn't require the CSE as INDEX() handles the array manipulation
I have a list of customers, and a spreadsheet that tracks each encounter with them. A sample table looks like this:
Workbook 1: Table of customers
+------------+----------------+---------------------+
| Name | Current Status | Last Date Contacted |
+------------+----------------+---------------------+
| Customer A | Active | 3/1/2018 |
| Customer B | Inactive | 3/2/2018 |
| Customer C | Closed | 3/3/2018 |
+------------+----------------+---------------------+
Workbook 2: List of encounters
+------------+------------+----------+
| Name | Status | Date |
+------------+------------+----------+
| Customer A | New | 1/1/2018 |
| Customer A | Active | 2/1/2018 |
| Customer A | Active | 3/1/2018 |
| Customer B | New | 1/2/2018 |
| Customer B | Active | 2/2/2018 |
| Customer B | Disengaged | 3/2/2018 |
| Customer C | New | 1/3/2018 |
| Customer C | Active | 2/3/2018 |
| Customer C | Closed | 3/3/2018 |
+------------+------------+----------+
I have the following formula to return the last date contacted:
{=MAX(IF(Encounters[Name] = [#[Last Then First Name]], Encounters[Date])))}
I would like a formula that looks for the most recent date for each Customer, and return the status associated with that date. Is there a way to do this with formulas. Keep in mind that the formula would need to continue to work even if the worksheet were to be sorted. Thanks!
Assuming your table of customers is in Sheet1 (columns A to C) and your list of encounters is in Sheet2 (column A to C), and you already have your latest date of encounter per customer in column C of Sheet1, then you can enter the following formula in Sheet 1 cell B2 (then drag down to your last customer):
=INDEX(Sheet2!$B:$B,MATCH(1,(Sheet1!$A2=Sheet2!$A:$A)*(Sheet1!$C2=Sheet2!$C:$C),0))
This allows you to capture the latest status per customer. The formula would however be pretty taxing on the efficiency of Excel's calculation, so you can change the reference ranges to your structured table references. Please don't forget to return the formula using CONTROL+SHIFT+ENTER.
Use the following standard (non-CSE) formulas to gain the latest date and accompanying status per the supplied image.
'G2
=INDEX(B:B, AGGREGATE(15, 7, ROW(A:A)/((A$1:A$10=F2)*(C$1:C$10=H2)), 1))
'H2
=MAX(INDEX(C$2:C$10-(A$2:A$10<>F2)*1E+99, , ))