Excel: get row from criteria - excel

I have one Excel file with two sheets. The first sheets contains data (Events with date and more information in columns), and in the second sheet I want to display Events from one sort of category and if they are in the future.
I tried various aproaches, but could't work it out at all. First I tried to transose the data from the first sheet, which made me realize was a bad approach, then I tried Vlookup which seems to be the best approach, but even after 6 tutorials I couldn't make it work to get the whole row, where the Category is "Walk Up".
To display a list with all "Walk Up" Events would be one first good step. After that I will have to check if the date for the events has been expired would be the second.
Criteria:
Event has EventType: "Walk Up"
Event has date > today
==> Get all Events matching the criteria
Any help or suggestions are much appreciated!
Daniel

let's assume you have a data setup like this:
[
I think the easiest way to achieve what you want is to create a helper column. In this example, we'll use column D. We'll also setup the criteria you want to pull by having those as sort of criteria information over your result set. It'll end up looking this this:
[
So to get it to look like that, I did the following:
Put this formula in your helper column (in this case cell D2 and copied down): =IF(AND(A2=$G$1,B2>$G$2),MAX(D$1:D1)+1,"")
Put this formula in cell F5 and copy down: =IF(ROW(F1)>MAX(D:D),"",$G$1)
Put this formula in cell G5 and copy over and down: =IF($F5="","",INDEX($A:$C,MATCH(ROW(G1),$D:$D,0),MATCH(G$4,$1:$1,0)))
At this point you can hide the helper column if preferred, and if you want your results on a different sheet, just cut and paste to a different sheet (in this case you'd cut columns F:H).

Related

Vlookup DragDown

Im beginning a new job in a fabric. Actually, for each product, they have a excel file with the product operations in different sheets. I saw that a real problem, it takes a lot of time, and every time we should have to change the layout of the order, we are going to need to change a lot of excel files.. It will take forever and I think I can help on that.
So, my idea, is making a sheet with all the products and their operations and formulas:
Then, I have maked another sheet with the order fabrication with all the operations needed to make the product:
Every product will have an ID and im using in all cells the vlookup function from the ID:
=IFERROR(VLOOKUP($K$3;'estrutura-artigos2'!B8:V71;5;FALSE);"")
And Its Ok like you see on the last image, the problem is when I change the ID it doenst change like it should be (on my head):
Can anyone help me on this problem? I want it to change always to the ID I insert, and dont continue with the new ID.
=IFERROR(INDEX(Sheet1!E:E;MATCH(1;($K$3=Sheet1!$A:$A)*(COUNTIF($A$6:$A6;Sheet1!$E:$E)=0);0));"")
As your examples show no columns or rows I made my own. Please modify the formula to your ranges. Sheet1 is your datasheet.
Column A in Sheet1 is the column holding the ID in your datasheet.
Column E in Sheet1 is the column holding the 'op' in your datasheet (between qty and machine column).
Counting starts at row 6 in my example, but modify it to the cell above where you put your formula.
Enter the formula with ctrl+shift+enter as it is an array formula.
Change the index for the different results, but keep the rest of the formula unchanged.
Updated answer based on the visibility in rows and columns:
In A13 use =IFERROR(INDEX(datasheet!F$8:F$72;MATCH(1;($K$3=datasheet!$B$8:$B$72)*(COUNTIF($A$12:$A12;datasheet!$F$8:$F$72)=0);0));"")
Match returns the row number of the first match where datasheet column B equals the value in $K$3 and where the values of datasheet column F don't equal any of the previous results of this formula in column A (above the current row number)
The result is the row number that needs shown from the indexed column.
For the issue im having, this is as far I already went thanks to #P.b:
The problem im having is that the formula Im using goes right no operation 20, instead going to the operation 1, any idea how to fix this?
Formula using on the A13 = =IFERROR(INDEX(datasheet!F:F;MATCH(1;($K$3=datasheet!$B:$B)*(COUNTIF(datasheet!$B$8:$B71;datasheet!$F:$F)=0);0));"")

return a value in a table from a seperate table

I have track and field results from 2 children. I've made separate sheets for each child.
The children did various events on various dates.
I want to make an automated overview of the results in one table.
That I can see in one row the results of the that event on various dates.
I can do it manually, but it is time consuming. and chance for error.
I've attached the excel sheet worksheet
I've looked to combine a Vlookup and Hlookup function as well as index,match,match function, but I only get a #NA return.
=VLOOKUP(A3;'Julian 2018'!A:C;HLOOKUP(B1;'Julian 2018'!A:C;2;FALSE);FALSE)
So in your case you could try this formula in H2:
=IFERROR(INDEX($C$1:$C$75,MATCH(H$1&$G2,$A$1:$A$75&$B$1:$B$75,0)),"")
Or:
=IFERROR(INDEX($C$1:$C$75,MATCH(1,(($A$1:$A$75=H$1)*($B$1:$B$75=$G2)),0)),"")
Enter both as array formula through CtrlShiftEnter
Dutch variant:
=ALS.FOUT(INDEX($C$1:$C$75;VERGELIJKEN(H$1&$G2;$A$1:$A$75&$B$1:$B$75;0));"")
Or:
=ALS.FOUT(INDEX($C$1:$C$75;VERGELIJKEN(1;(($A$1:$A$75=H$1)*($B$1:$B$75=$G2));0));"")
Drag right and down....

Generate or fill cell data based on another dataset excel

I've a data set that shows;
employee name
date
time work started
time work ended
Now I am trying to have a report like sheet where I can select a certain employee name from a list of employees to view his/her time attended for a particular month.
I tried vlookup but went no where since I need to lookup by two columns plus a row.
Is this possible? without macros or vba.
Thanks
Since name and date are unique identifiers it is possible to use the sumifs function.
For ‘time in’ and ‘Rachel’ this will look as follows:
=Sumifs(column ‘time in’ from data set, column ‘name’ from dataset, “Rachel”, column ‘date’ from data set, “10/01/2017”)
Where Rachel and the date also can be a referenced cell.
=AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1)
The above formula will grab the row number that matches your criteria. to pull the information you want, you can place the row number inside an INDEX formula to get the following:
=INDEX(SHEET1!$D:$E,AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1),COLUMN(A1))
You can place the above in your first Time cell and copy right and down. You will see errors if criteria do not exist. ie no person of that name or no date data for that person. to avoid this you can wrap the whole thing in an IFERROR like the below:
=IFERROR(INDEX(SHEET1!$D:$E,AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1),COLUMN(A1)),"Nothing found")
if you would rather a blank than nothing found display change the "nothing found" to "" or 0 if you want 0 to be displayed.
Note: Aggregate is performing array like calculations in this case. As such you do not want to full column references as it will cause a lot of unnecessary calculations to be performed. Because you have unique entries, SUMIFS option given in another answer is a much better choice.
I think a pivot table will do the job for you.
Place the employee name in the filter, place date and
times in the rows.
Remove subtotals from the Pivot Table
Change Table layout to tabular and Repeat rows
Right click on the Time In and select Ungroup
Then you have the image below.
I have the following layout:
In B11 write this formula and drag down:
=INDEX($B$2:$E$5,MATCH($B$7&$A11,$B$2:$B$5&$C$2:$C$5,0),3)
In C11 write this and drag down:
=INDEX($B$2:$E$5,MATCH($B$7&$A11,$B$2:$B$5&$C$2:$C$5,0),4)
Note that these are Array-Formulas, so you need to enter them with CTRL + SHIFT + ENTER instead of the normal Enter.
You will get a #NV error if the employee hasn't worked on one of the dates A11 and A12. So you could surround the Formula with IFERROR to avoid this.

SUMIFS across a range of sheets

I'm building an excel home finances/budget workbook. I would like to keep the transactions for each account on separate sheets with my budget sheet separate from those. I was looking for a way to sum the categories without hard-coding the names of the sheets used. I setup the sheets as follows.
Budget - Start - Account1 - Account2 - End
I have more accounts to add once i get it working. This is all prototyping to make sure I can do what I want.
I found I can do the following to sum everything on all sheets between Start and End (as long as those are blank).
=SUM(Start:End!B1:B10)
What I can't get working is a SUMIFS
=SUMIFS(Start:End!B1:B10,Start:End!A1:A10,"Count")
In column A a cell that has "Count" or "Don't". These will eventually become categories. The above gives me a "#VALUE" error. I wasn't able to get SUMIF to work either. I may add other conditions down the road.
Am I doing something wrong? Is there an easy way to do something like this?
I got it to work by making a Range E2:E4 containing the names of the sheets, the first being "Start" and the last being "End".
I also have a criteria box E7 with value "Count"
Start
I've populated columns A1:A10 with either "Count" or "Don't".
I've populated columns B1:B10 with numbers.
Sheet2(left) and End(right)
Then I used this formula to return the desired result:
=SUMPRODUCT(SUMIF(INDIRECT("'"&E2:E4&"'!A1:A10"),E7,INDIRECT("'"&E2:E4&"'!B1:B10")))
Don't know if that helps you but it does produce the desired results with the extra work of writing up a sheet list and a criteria list.

Excel formula to get specific data that according to another column

I have a spreadsheet that contains various sheets, each sheet contains different types of orders including items, descriptions, quantity, etc.
ITEM DESCRIPTION QTY
Apple ... 1
Orange ... 4
I would like to get a formula that is capable to find out the total quantity of items from every sheet.
If you want to do it in a single cell, I'm afraid the only way of doing so without VBA is to make a manual search over all the pages :
= SUMIF(Page1!A:A,"=ItemName",Page1!C:C)+ SUMIF(Page2!A:A,"=ItemName",Page2!C:C)+ ...
Other solutions would involve you creating your own personal vba function or adding new cells in each sheet which I'm not sure are within the realms of possibilities.
If all your sheets with "data" on them are the same format, you can save time and maintenance by doing the following:
create a sheet called start which is before all the "data" sheets. This sheet should be blank (except perhaps for a bit of text saying "this sheet is intentionally blank")
create a sheet called end which is after all the "data" sheets.
Then in your summary sheet, you can do =SUM(start:end!C:C) (I'm assuming your quantity is in column C from your example above).
If you use this approach, you can easily add sheets in between start and end; the formula will not need to be rewritten
Per #l3echod's comment in another answer, you can also use this pattern in SUMIF and SUMIFS formulae, if you want total quantity per item:
=SUMIF(start:end!$A:$A,$A2,start:end!$C:$C)
this assumes the item in question is in cell A2. Note that depending on the volume of data you have, this might be a slow formula to calculate.

Resources