Matching the First Values of two columns in new column - excel

I am having problem setting up log in excel.
I have this data from restaurant. Which includes
Date | Time | Table Number |Checkin Time | Bill Number | Order Quantity | ... | .......
I am trying to calculate the Checkin Time ( Column D)
From First "Time" to Same Table Number and Same Bill Number.
Here is the screenshot attached.
Here in Screenshot you can see the 1st time (b24) is 18:05:13
Now I want that time to D24 cell till the Blue marker of Column C and E .
I tried the following
=IF(AND(E24=E23,C24=C23,A24=A23),D23,MIN(OFFSET(E24,0,-3,MATCH(0,(E24:E$15973=E24)*(C24:C$15973=C24)*(A24:A$15973=A24),0)-1,1)))
It does the same thing, But as same table number and same bill number is repeated at the bottom, the time changes, same time doesnt show up. It shows new time.
Here is the link for excel file too. Sheet is TRN .
Please help me.
I can do it manually but Its about 1 months data. and will take forever doing one by one. excel File

I believe this is what you want:
Create a new column, Using your spreadsheet, I've added it as M. Concatenate the three criteria columns here with the formula A&B&C = either do it as an array, or in M2 put =A2&C2&E2, then copy down.
Now in the column N, put the following formula at N2 and copy down: =MINIFS(B:B,M:M,M2)
Job Done.

Related

Display in Sheet1 newest entries from Sheet2 to Sheetn in excel

I have an excel file which has an arbitrary number of sheets. From Sheet2 to Sheetn the structure is the same:
| A | B | C | D |
------------------------------
| Date | Name | Value | Type |
| Date | Name | Value | Type |
However, these rows are not sorted by the date, so the 1st row of each sheet is not guaranteed to be the newest date.
The first sheet has one row for each sheet and it should be updated to include the most recent entry in each sheet.
For example, if we have 4 Sheets, then Sheet 1 will have 4-1=3 rows which will be: the row with the newest date of Sheet 2, the row with the newest date of Sheet 3, and the row with the newest date on Sheet 4.
A file equals a thousand words, so you can download the excel file here and see what I need.
I've actually figured out a solution. I'm guessing it's significantly far from the best one, but since I'm by no means an excel person, the fact that it works is enough for me.
For other non-excel people who just need to achieve this without learning excel, here's how I did it:
=INDEX(MySheetName!$A$2:$G$10000,(MATCH(MAX(MySheetName!$C:$C),MySheetName!$C:$C,0)-1),COLUMNS(MySheetName!$A$1:A1))
Replace "MySheetName" on its 4 occurrences to the actual Sheet name of each of your excel's sheets.
Replace Columns 'A to G' on the INDEX to the columns you want to retrieve.
Replace Column C:C on the MATCH to the column you want used to retrieve the row number using its MAX()
Remember to span the formula to multiple columns, as many as the maximum columns that the sheet you reference has.
What I'd like to improve now is to make it able to span multiple rows as well, which for me it would mean that it would automatically reference all the columns of the next excel sheet. For now, one needs to manually replace "MySheetName".
The "10000" also looks really bad, but I don't know how to many sure that it will get the Max() over all rows. I'll never fill more than 100 rows on each sheet, so 10000 seems safe.

Excel Complex Conditional

Ok so I did this in LibreOffice but now I have to duplicate it to excel for my Pay Roll department since they use excel. So I am having to figure out how to convert the formulas to Excel. This is only 1 of two totaling formulas that did not convert when I saved it as Excel format.
I have the following sheet called DailyReport
I am currently calculating Column M with =SUMPRODUCT(A2:A200=A2, G2:G200)
Then on a secondary sheet I have the following second sheet WeeklyReport
Now what I want to do is if WeeklyReport Column A2 == DailyReport Column A then take the date in DailyReport Column B and test it to fall in the date range in WeeklyReport Column B and Column C with =IF(AND(DailyReport.B2>=B2,DailyReport.B2<=C2),1, 0) and if that is true add the Total Daily Hours to the total in WeeklyReports Column D from DailyReports Column M
I hope this is clear enough if not please let me know what else I can do to make my question more clear.
Thanks in advance!
So, to me it sounds like:
You want a sum of all hours, for a specific employee (defined by the A column value weekly report), in between the dates specified (also defined by weekly report, b & c column) - and you want the end result to be in WeeklyReport column D and all of it to relate to the same row as the result?
sumproduct will do the trick. I am renaming your sheets to DR and WR for my sanity's sake.
=sumproduct((DR!G$2:G$200)*(DR!A$2:A$200=A2)*(DR!B$2:B$200>=B2)*(DR!B$2:B$200<C2))
Now, if you want a new daily report sheet every day it gets a bit trickier to do with formulas alone, you should then have a macro to store the "current" value and add the "new" value, or for simplicity's sake create more columns (one for each working day) and duplicate the formula to all daily columns, or have as many named dailyreports as there are working days in a week and increase the formula to check multiple sheets. I would add columns - least amount of work and the dumbest solution often proves the most resilient.
Did that help in any way?

Automatically working out the average of filtered results

I have a spreadsheet where column P has a score between 1-6
The cell O4 has the following formula: =AVERAGEIFS(P8:P5000,P8:P5000,"<>6",P8:P5000,"<>0")
This formula searches for the average of the score in column P excluding 6, blanks and 0
Column O has staff names e.g John, Mark, Tim.......
What i want to do is for Cell O4 to automatically calculate the average of the figures shown in column P after i have used the filter function to show only results of a selected staff member.
I was hoping excel might be able to do this automatically however cell O4 appears to still be showing the average of the whole column P regardless of whether i have filtered or not.
I was given the formula below on another forum but it seems to be giving slightly wrong results albeit only by a small amount but i need to have the results exact if possible. Any help appreciated.
=SUMPRODUCT(1-ISNUMBER(MATCH(P8:P100,{0,6},0)),SUBTOTAL(9,OFFSET(P8,ROW(P8:P100)-ROW(P8),0,1)))/SUMPRODUCT(1-ISNUMBER(MATCH(P8:P100,{0,6},0)),SUBTOTAL(2,OFFSET(P8,ROW(P8:P100)-ROW(P8),0,1)))
Maybe
{=AVERAGE(IF((P8:P5000<>6)*(P8:P5000<>0)*SUBTOTAL(103,INDIRECT("O"&ROW(8:5000))),P8:P5000))}
will do what you want. Assuming the Filter is on column O.
The 103 in SUBTOTAL will also exclude if rows are manually hidden. If this ist unwanted and it should only exclude hidden rows, if filtered, then use 3 instead.
This is an array formula. Input it into the cell without the curly brackets and then press [Ctrl]+[Shift]+[Enter] to create the array formula.
I would create a separate table in a new sheet with all unique staff members and then perform the calculation. This way, you can quickly compare values for all staff just by scanning the table instead of having to constantly update the filter to see the values for potentially dozens or hundreds of staff. You would add the staff name range and criteria to your AVERAGEIFS formula.
For your example:
Sheet 2
A B
--- ---
1 | Staff Average
2 | Bob =AVERAGEIFS(Sheet1!$P$8:$P$5000,Sheet1!$O$8:$O$5000,A2,Sheet1!$P$8:$P$5000,"<>6",Sheet1!$P$8:$P$5000,"<>0")
3 | Mary =AVERAGEIFS(Sheet1!$P$8:$P$5000,Sheet1!$O$8:$O$5000,A3,Sheet1!$P$8:$P$5000,"<>6",Sheet1!$P$8:$P$5000,"<>0")
4 | Joe =AVERAGEIFS(Sheet1!$P$8:$P$5000,Sheet1!$O$8:$O$5000,A4,Sheet1!$P$8:$P$5000,"<>6",Sheet1!$P$8:$P$5000,"<>0")

Search for specific number in column and fill cells from its adjacent cells

I have a list of employee ID's for each period of the year. Each ID has Specific stats for that time period. The problem I'm running into is the list order changes every period according to the employees tasks.
Cell 1A contains the Employees ID#(ID's are Numbers only if that makes a difference). Column B has the whole list of employee ID#. I need to figure out how to write a formula or vba that checks column B for the ID# that matches 1A and populate 1C-1J with the adjacent data found in column B (columns C-J).
I hope I explained myself correctly without being to confusing. I appreciate any help.
The vlookup formula looks at the first column of $B:$J (column B) and searches for $A$1 and if it finds it returns the value in the 2.(3.,4.,...,9.) column of $B:$J
A1 | B1 | =VLOOKUP($A$1,$B:$J,2,FALSE) | =VLOOKUP($A$1,$B:$J,3,FALSE) | =VLOOKUP($A$1,$B:$J,4,FALSE) | ... | =VLOOKUP($A$1,$B:$J,9,FALSE)

Excel - How to copy rows and discard others based on today's date?

I have a worksheet, and in one sheet called Payments, every row, on column A has a date in ascending order, on column C there's a client name, on column E there's a monetary value and on column G there's a Yes/No Checkbox.
The Dates sometimes repeat themselves, but the other values, do not (the Y/N/ Checkbox also repeat themselves). So, sometimes i have:
m / d / y
02/02/2014 - Client X - 100,00 - y;
02/02/2014 - Client Z - 120,00 - n;
02/03/2014 - Client W - 110,00 - n;
etc.
What I need is this: on another sheet called Today's Dues, in the same worksheet, when colum A from Payments sheet (the date column) is today's date, the entire row from that column from A to G) is copied to Todays Due sheet. And the same would apply to all the other rows where the A column had todays date. But, tomorrow, that sheet would need to update itself, so the information from yesterday would not be there anymore, just the new rows with the new day's date.
Since there is no more than 10 payments a day, the space available on Todays Due would not need to be bigger than 10 rows, but would have to get information from the entire A column of Payments sheet.
What is was thinking was to create a Macro that would duplicate ALL data from Payments sheet, then automatically apply a filter with todays date. This Macro would be the first thing happening on opening. But this has been proving to be very frustrating. I cant seem to make Excel recognize my dates as dates, only as text, i tried everything.
Any help, or a more elegant solution, please ?
thanks
Assuming multiple rows of same date are in order, these should work.
Date:
=IF(INDEX(Payments!A:A,MATCH(TODAY(),Payments!A:A,0)+ROW()-2)=0,"",INDEX(Payments!A:A,MATCH(TODAY(),Payments!A:A,0)+ROW()-2))
Client Name:
=IFERROR(INDEX(Payments!$C:$C,MATCH($A2,Payments!$A:$A,0)+ROW()-2),"")
Value:
=IFERROR(INDEX(Payments!$E:$E,MATCH($A2,Payments!$A:$A,0)+ROW()-2),"")
Yes/No:
=IFERROR(INDEX(Payments!$G:$G,MATCH($A2,Payments!$A:$A,0)+ROW()-2),"")
Put each formula in consecutive columns to get your 4 unique values. Drag these down for 10 rows to collect all possible values.
**Note: The 2 in "ROW()-2" will be whatever row number you start this on. I used 2 since I put headers in the first row.

Resources