How to Filter out Duplicate rows(By a specific column) in Excel or Open Office CALC ?? - excel

I want to filter out rows in Excel/Open Office CALC like this :
Here is My Table Structure
Emp_No and Note Added are the column names
Emp_no. Note added
10 salary due by 13th Oct
10 salary pending
10 salary paid
10 salary not paid
23 salary paid
23 salary not paid for 2 months
23 salary due this month
Now, I want to keep only the first ROW from the set of rows containing Emp_No as 10 and keep only first ROW from the next set of values containing Emp_No value as 23.
So in short, I want a output like this :
Emp_no. Note added
10 salary due by 13th Oct
23 salary paid
Kindly help !!

With a helper column this formula:
=IF(B1=B2,"",B2)
in Row2 and copied down should pick out the first instance (each change) in Emp_no., if that is in ColumnB.
Filtering to select (Blanks) in the column with these formulae should then pick out all the rows where the Emp_no. is the same as the row immediately above - at which point they may be deleted to achieve the result shown as required from the data sample provided.

Related

Need to revise this formula that displays data based on another cell's contents

I can't get this formula working properly. Here is what I need to do (see included image below):
I need the data in rows 9-10 (sales) to be displayed/copied in rows 28-29 (collections) based on the number in cells C9 and C10 (payment terms). For example, if there are $1,900 in GM sales on Tuesday, Jan 5 (cell F9) and payment terms are 10 days (cell C9), then I need $1,900 displayed on Tuesday, Jan 19 (cell P28), in the collections section (rows 28-29), 10 business days from when the sales were made. Does this make sense? Here is the formula I am using now (starting in cell E28 and being dragged to the right):
=IF(COLUMN() - E9 < 1, 0, INDIRECT(ADDRESS(9, COLUMN() - $C$9)))
However, it is not working completely. It is moving the data labels to the left of the data table that are not supposed to be included in the data table. Only sales data starting in cell E9 are supposed to be moved. You can see this issue in row 28 (columns J-N) in the image below.
This formula also has to work with payment terms from 1 day - 10 days. So, the $5,000 in Ford sales on Monday, Jan 4 (cell F10), with payment terms of 3 days (cell C10), needs to be displayed on Friday, Jan 8 (cell I29).
Let me know if you need any additional details to solve this issue. Thanks!
Is this what you're looking for?
=IFERROR(INDEX($E$9:$X$13,MATCH($B28,$B$9:$B$13,0),MATCH(WORKDAY(E$5,-INDEX($C$9:$C$13,MATCH($B28,$B$9:$B$13,0))),$E$5:$X$5,0)),0)
The formula indexes the sales amounts and shows the amount in the row where the customer name mentioned at sales equals the customer at the result section with the column where the result date equals the date mentioned at sales minus the number of workdays mentioned behind the customer name at the sales section.

Count on how many tickets are logged this month - per series

I have two columns - one with ID's in and one with the date it was created on.
Is there a way which will do a count on how many ID's were created in the current month - and will automatically reset itself when it falls into the next month.
E.g.
ID Creation Date
8.88 01/01/2019
8.89 01/01/2019
8.9 01/07/2019
1.1 01/07/2019
1.2 01/06/2019
1.3 01/05/2019
1.4 01/04/2019
5 01/07/2019
5.1 01/07/2019
5.2 01/06/2019
5.3 01/06/2019
If i use the current month (July 2019) - i would hope to see - ID which begin with 8, there was 1 created this month. ID'w which begin with 1 - 1 was created this month & ID's which begin with 5 - there were two created this month
Thank you
Assuming your data starts in A1 it would come down to:
"Is there a way which will do a count on how many ID's were created in the current month - and will automatically reset itself when it falls into the next month."
To get the total of entered ID's:
=SUMPRODUCT(--(MONTH(B2:B12)=MONTH(TODAY())))
You could also use a COUNTIFS formula like so:
=COUNTIFS(B2:B12,">="&EOMONTH(TODAY(),-1)+1,B2:B12,"<="&EOMONTH(TODAY(),0))
"Is there a way that it can be broken down into each ID. E,g, Taking the LEFT 1st number - e.g. Just reference against the 5 series numbers and returning the results."
To get the total of unique series numbers entered:
=SUM(--(FREQUENCY(IF(MONTH(B2:B12)=MONTH(TODAY()),MATCH(LEFT(A2:A12,1),LEFT(A2:A12,1),0)),ROW(A2:A12)-1)>0))
Entered as array formula through CtrlShiftEnter
If the dates are true dates then you can make a pivot table.
First we need to split the ID data on the "dot".
Insert a new column between ID and creation date.
Select the ID column and click Data -> text to columns.
Split the column on ..
The new column (B) needs to have a header. Just write whatever you want as header.
Go to insert -> pivot table
Then just drag creation date to Rows field (the months will be added automatically) then and ID to also to Rows field.
Then drag ID to the values field.
EDIT. I see now that my image shows the dates also. You can remove that from the rows field by just dragging it up again to the list.

Find row when Cumulative sum reaches certain value with condition

I have a table with 3 columns Date, Item and Number. Each row indicates how many items of each Item was received on that date. I am trying to find the date on which cumulative sum reaches 100 or more in that month. Each month will have a target for each item which will be saved in another sheet but for simplicity we can assume that its a fixed number of 100.
Example Data:
Date Item Number
1/2/2018 A 10
2/2/2018 B 10
2/2/2018 A 15
5/2/2018 C 25
6/2/2018 A 50
7/2/2018 B 10
7/2/2018 C 10
8/2/2018 A 25
9/2/2018 A 20
I am looking for the formula which should act on the data similar to above and give the result as 8/2/2018 which is the date on which the cumulative sum for Item A reached 100.
Each month will have different target number, and will have different number of entries.
I have tried using SUMIF and adding a additional column etc but this data is just part of a big data and each item limit is saved in a different sheet etc which is not easy to merge. Thanks in advance for help.
In Excel only, you can use Offset to develop an array of items and numbers containing 1,2,3...9 rows and then SUMIF to add each of them up. Then use Match to find the first one =100 and Index to find the matching date (in F2):
=INDEX(A2:A10,MATCH(100,SUMIF(OFFSET(B2,0,0,TRANSPOSE(ROW(A2:A10))-ROW(A1)),"A",OFFSET(C2,0,0,TRANSPOSE(ROW(A2:A10))-ROW(A1))),0))
Must be entered as an array formula using CtrlShiftEnter.
EDIT
To find the first sum which is >=100 (in G2):
=INDEX(A2:A10,MATCH(TRUE,SUMIF(OFFSET(B2,0,0,TRANSPOSE(ROW(A2:A10))-ROW(A1)),"A",OFFSET(C2,0,0,TRANSPOSE(ROW(A2:A10))-ROW(A1)))>=100,0))
Sum which reaches exactly 100
Sum which does not reach exactly 100 (the number in row 9 has been changed to 24):

i want to have a single column containing different values for each month

I have created a table in excel for keeping the leave records of staff. I created a scroll bar to scroll to a different month. I have added an extra column named "leave this month" which shows how many days a person has taken leave. but when I scroll to a different month (for example from January to February) the column's data stays the same. I want it to have different data for different months. for example for January it is 3 days, for February it is 4 days and... I want different values in the same cell for different months.(when I scroll to a different month the value should change) do you guys know how to do that?
screenshot
Sub showcalendar()
LeaveTracker.Columns("C:NJ").Hidden = True
LeaveTracker.Range(Columns(Range("B3").Value * 31 - 28),Columns(Range("B3").Value * 31 + 2)).Hidden = False
End Sub
Here is the approach I would use:
Define a spreadsheet with 31 X 12 columns (each group of 31 columns would represent a month, even for those cases when the month has 28/29/30 days); this spreadsheet will be use as the storage of the raw data (i.e. presence/absence of a person each day of the year),
A second spreadsheet to be use for display will have the cells linked to the first one with an horizontal offset (to the right) to be calculated as 31 * (month_number - 1); as such, when looking at the information of March, the offset would be 62 columns to the right.
Your scrollbar would run from 1 to 12 and set the value of the month (which would then be used to calculate the offset.
In this way, you don't need to copy-paste anything and, instead, you have a sliding "window" that runs right and left over your raw data sheet.
Hoe this description is clear.
So you basically have 365 columns for each day of the year. On row 4(or wherever suitable) add the month number i.e. for the first 31 columns, cells will have 01 in row4. For the next 28 columns cells in row 4 will have 02 and so on.
then in NK8, the formula to be entered should be
SUMIF($C$4:$NJ$4,$B$3,C8:NJ8)
which you can drag down for each person. B3 ahs the current month number you are viewing. The formula basically sums only those cells whose corresponding cell in row4 matches the month number in B3.
Here is a Google Sheet example.

Excel: Trailing 3 month decline using data from a pivot table

(http://stackoverflow.com/questions/5283466/calculate-moving-average-in-excel seems to be somewhat related. I'm curious to know the non-vba way to do this.)
My my pivot table has source data that creates a count of how many sales a person had in the past 36 days. Each day os 1 column in the pivot table, and the persons name is on the row.
Some of these people did not have sales on day1, day2, etc, and may only have 3 days where they sold something on days 14,15 and 16. No matter what their sequence, I want to to find the most recent sale data (closest to the right edge of pivot table) and calculate three sales increases e.g. C20/C19 will be >1 if they had more sales on the whatever day C20 is. The increase ca nbe fond by subtracting 1 and changing to percent. The problem is, if a person only had sales on d10, d11, d12 then how can I put a general formula in Excel to say "look for the most recent consecutive sales, then calculate this ratio"? For a person who had sales in the past three days, that's easy. It will be chaotic to hardcode where to look for each sales value.
d1 d2 d3 d4...d7 d8 d9...d34 d35 d36 mostrecentincrease nextrecent
ant 1 5 7 7/5=1.4 5/1=5
bat ...10 11 12... 12/11=1.blah 11/10=1.1
cat 2 6 9 13
dog 19 20 20/19=1.blah 19/blank=0
elf 4 4/dnexist=0
i don't have excel here, but i hope this will guide you to the correct result (use , instead of ; if that is your list separator):
define sales as a range of values from d1 to d36 for a given row (or use actual ranges)
compute positions of the last values for each row using these array formulas (use ctrl+shift+enter instead of just enter after you write these formulas):
position_1 =max(if(sales<>0;column(sales)))
position_2 =max(if((sales<>0)*(column(sales)<>position_1);column(sales)))
position_3 =max(if((sales<>0)*(column(sales)<>position_1)*(column(sales)<>position_2);column(sales)))
retrieve the values:
value_1 =index(sales;position_1)
do some error handling (=iferror(...;0)) and the like...

Resources