I've doing these manually for the last for the last year and hoping I can get some help and guidance on how to execute this better using Excel
Sheet 1
Client Name | SKU | Description | Oct Qyt | Oct fee | Nov Qty | Nov Fee | Dec Qty | Dec Fee | Total
John, Doe | 1234 | red wine | 12 | $12 | 12 | $12 | 12 | $12 | $36.00
John, Doe | 3456 | white wine | 6 | $6 | 3 | $3 | 0 | $0 | $9.00
Kent, Clark | 6789 | etc..
Same client has multiple SKUs and SKUs vary in quantity each month and I need to figure out the total.
I need to translate the above data to one invoice by client name:
SKU, Description, Oct Units, Fee, Nov, Units, Fee, TOTAL.
Is there a way to easily process this in macros or with vlookups? I tried vlookups and, since there are multiple products under one person, it's not working properly.
I need to do this to generate over 150 invoices, save them individually, convert to pdf, and email it to clients.
Absolute easiest way would be with a pivot table.
If you want to do something using macros, you could start by creating a sheet for each client. I use this macro sometimes by highlighting a distinct list of names and running the macro:
Sub CreateSheetsWithTheseNames()
Dim CurName As Range
For Each CurName In Selection
ActiveWorkbook.Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = CurName.Value
Next CurName
End Sub
This could be modified to just look through column A and creating sheets for every name that does not already have a sheet with that name.
If you had a pivot table setup already, the above macro could be modified to copy the pivot table sheet for each client and filtered accordingly. From there, each sheet can be saved as a PDF.
I could probably expound some on the macros if need be.
For the sake of an answer.
Try a PivotTable, with Client Name in Report Filter, SKU and Description in Row Labels and Sum of each of Oct Qyt, Oct fee, Nov Qty, Nov Fee for Σ Values.
Related
I would like to generate a chart with the monthly status of opened claims based on the creation date and closing date.
Let's suppose I have 3 claims:
Claim No. | Date created | Date closed
X7348 | 01.Jan | 01.April
Y6778 | 01.Mar | 01.April
G7847 | 01.Feb | 01.May
The chart should indicate the status like this:
Jan | Feb | Mar | Apr | May | Jun
1 | 2 | 3 | 3 | 1 | 0
So, claim X7348 had the status open in Jan, also in Feb, Mar and April.
Update:
In fact my data's have and XML source and loaded into a Table which can change the range.
I think the result must come from a Pivot.
I've tried to create a calculated field with COUNTIFS formula behind, but give some errors like the one attached:
=COUNTIFS(DATE_C3,"<="&DATE_C3,DATE_D5_COMP,">="&DATE_C3")
Create your desired months Jan|Feb...as dates
Then, you can use date math to get it.
For example, here, I put your input data in A1:C4
The formulas for each month of output are like:
=COUNTIFS($B2:$B4,"<="&F1,$C2:$C4,">="&F1)
I have a table where each row represents one logical value.
Sort of like this:
| January | Margaret | 10 |
| February | Jeff | 20 |
| March | William | 30 |
I want to transfer the data to another table, where the data would be modelled as following:
| | January | February | March
+----------+---------+----------+------
| Margaret | 10 | |
| Jeff | | 20 |
| William | | | 30
In the case of changes in the Table 1 same changes should be reflected in the Table 2
There are only 4 names and 12 months. Names are repeated A,B,C,D,A,B,C,D,A,B,C,D.
Numbers are 10-120. Obviously I can use = and click on the cell in the first table but I need more optimal solution. I can't figure it out. Any advise would be much appreciated!
It sounds like what you're trying to do is called a long to wide transformation. In this case, since you just have months, it might be easiest to create a table with your months as headers (i.e. January - December), and then write a INDEX/MATCH formula to fill it in.
Let's say this is your table, starting in cell A2
Date Name Value
January Jone 1
January Mike 2
January Bob 3
February Jone 4
February Mike 5
February Bob 6
Then create a table with a header row for the months, starting in B10
January February March April May June July August September October November December
And a column for the unique names, starting in A11
Jone
Mike
Bob
So the whole thing looks like this:
January February March ...
Jone
Mike
Bob
Then we use an INDEX/MATCH formula to fill in the table. Write this in cell B11, then fill down and across:
=INDEX($C$3:$C$8,MATCH(1, INDEX(($A11=$B$3:$B$8)*(B$10=$A$3:$A$8),0,1),0))
This says, return a value from C3:C8 where both A11 and B10 match in their respective ranges B3:B8 and A3:A8.
You end up with:
January February ...
Jone 1 4
Mike 2 5
Bob 3 6
You can use Get&Transform to
Pivot Column 1
Advanced Options: Don't Aggregate
Values Column: Column 3
In my theoretical data set, I have a list which shows the date-time of a sale, and the employee who completed the transaction.
I know how to do grouping in order to show how many sales each employee has per day, but I'm wondering if there's a way to count how many grouped days have more than 0 sales.
For example, here's the original data set:
Employee | Order Time
A | 8/12 8:00
B | 8/12 9:00
A | 8/12 10:00
A | 8/12 14:00
B | 8/13 10:00
B | 8/13 11:00
A | 8/13 15:00
A | 8/14 12:00
Here's the pivot table that I have created:
Employee | 8/12 | 8/13 | 8/14
A | 3 | 1 | 1
B | 1 | 2 | 0
And here's what I want to know:
Employee | Working Days
A | 3
B | 2
Split your Order Time column (assumed to be B) into two, say with Text to Columns and Space as the delimiter (might need a little adjustment). Then pivot (using the Data Model) as shown:
and sum the results (outside the PT) such as with:
=SUM(F3:H3)
copied down to suit.
Columns F:G may then be hidden.
I fully support #Andrea's Comment (a correction) on the above:
I think this could have been made simpler. If you remove the "Time" in values of the pivot table and then move "Order" from columns to values and use distinct count as in the example. It should count Employee per date making the sum not needed. If you scale this to make it larger. Say 50 dates then the =Sum() needs to be moved each time.
I have an excel file containing two spreadsheet as shown below. I want to update value Comm Level in Sheet 1 with Comm Level in sheet 2 provided that Modem ID in sheet 1 matches Modem ID in sheet 2. How to do automatically do this in Libre office ? Can someone suggest me some formula or script which will work in Libre office as I do not have license for MS office.
Sheet 1
Modem ID | Comm Level
-----------------------
70000 | 90
70001 | 90
70004 | 90
70007 | 90
70010 | 90
Sheet 2
Modem ID | Comm Level
-----------------------
70001 | 80
70002 | 90
70003 | 60
70004 | 90
70009 | 90
Thanks
Assuming Modem ID is in A1 on both sheets. In C2 of Sheet1 and copied down to suit:
=IFERROR(VLOOKUP(A2,Sheet2.A:B,2,0),B2)
Looks for a corresponding value with VLOOKUP where a match exists and if not found defaults to existing value with IFERROR.
I have a table of data that has a format similar to the following:
EventID | Event Date
--------------------
1 | 1/1/2014
2 | 2/8/2014
3 | 10/1/2014
4 | 2/5/2014
5 | 4/1/2014
6 | 9/1/2014
What I am trying to do is create a DAX formula to rank each event in the order that it happened for the year. So I want to end up with something like this. This way I can compare the events year over year as the events don't happen on any regular time schedule.
Event Date | Year | Rank
------------------------
1/1/2014 | 2014 | 1
2/8/2014 | 2014 | 2
10/1/2014 | 2014 | 3
2/5/2015 | 2015 | 1
4/1/2015 | 2015 | 2
9/1/2015 | 2015 | 3
I have tried to do this by creating a formula that will give me the day number of the year:
Day of Year =(YEARFRAC(CONCATENATE("Jan 1 ", YEAR([Event Date])),[Event Date])*360)+1
Then using rankX on this table, but I cant seem to get the proper result. Perhaps I am not understanding the use of rankX or going about this the right way.
=RANKX(FILTER(Event,EARLIER(Event[Event Year])=Event[Event Year]),Event[Day of Year])
or
=RANKX(All(Event[Event Year]),[Day of Year],,1,Dense)
Any ideas would be much appreciated!
Thanks for any help in advance!
Create the following measures:
[Year]:=YEAR(LASTDATE(Event[Event Date]))
and
[Rank]:=RANKX(FILTER(ALL(Event),[Year]=YEAR(MAX(Event[Event Date]))),FIRSTDATE(Event[Event Date]),,1,DENSE)
and this is the result that you get:
Note: My dates are in UK format and I suspect yours were in US format, so the rankings do not appear to tally with your example, but it does work!