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.
Related
In my sheet, my top row is a bunch of dates and I have columns separating the weeks.
| 1.1 | 1.5 | 1.12 | 1.29 |JANUARY TOTAL| 2.3 | 2.15 | FEBRUARY TOTAL|
----------------------------------------------------------------------
Below each date is the number of hours worked on a project, and in each "MONTH TOTAL" column is a sum of the time worked on each project per month.
When I created this spreadsheet, I put in a filler of 2 blank spaces, but since I can't predict when I'll be working on each project, I have to rely on inserting new columns if I decide to work on something on a day that isn't preset into the sheet.
The problem is that my formulas don't extend all the way to the MONTH TOTAL columns when I insert new columns. For instance, when I create my spreadsheet, my formula for one of the totals in the MONTH TOTAL column would be "=SUM(B2:C2)" but when I insert two more dates I need the formula to be "=SUM(B2:E2)".
Is there a way to encapsulate inserted cells into a formula so that it sums between a bound of two columns and any new inserted cells?
You can use the INDIRECT function coupled with ADDRESS, ROW, and COLUMN.
In your stated example, let's assume your "MONTH TOTAL" formula is in D2 and currently contains =SUM(B2:C2). You will want to update the formula to:
=SUM(B2:INDIRECT(ADDRESS(ROW(),COLUMN()-1)))
Whenever you insert a new column, it will still SUM by referencing the values in the preceding columns.
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.
I am trying to create a summary sheet that details the amount of a certain product number found in a separate tab. The inventory tab has around 50k records that are filtered by certain manager names.
I need to search by the first four numbers on the inventory tab to match column A on the summary sheet.
Example: The summary sheet may list the model type as 1234, but the inventory sheet lists it as 123463AW3234.
| Model | Codename | Marketing | Quantity |
|-------|----------|-----------|----------|
| 1234 | CN 1 | MN 1 | 1 |
| 1234 | CN 1 | MN 1 | 12 |
| 1234 | CN 1 | MN 1 | 13 |
I would add a formula into column D cells (quantity) that takes the text from cells within column A (model type) searches that through the inventory tab, and lists the quantity of that model type.
This is the formula I have so far, but it detects all cells with 1234 anywhere in the test. I need to edit it where it will only search for the first four numbers taken from column A.
=SUMPRODUCT(SUBTOTAL(103,OFFSET('Development-Asset list'!G2:G33080,ROW('Development-Asset list'!G2:G33080)-MIN(ROW('Development-Asset list'!G2:G33080)),,1)),ISNUMBER(SEARCH(B5,'Development-Asset list'!G2:G33080))+0)
Column G is a seperate tab and contains the full 10 digit product number. I want to pull the data from the model cell (A1) and use it to count the number of products in the sep tab G row.
These rows are filtered which is why I am using SUMPRODUCT. So column G has product numbers like 1234abcde and I want to pull data from A1 (1234) and search column G for matches, but only the first four characters.
Any help would be appreciated!
How about:
=SumIfS(ColumnToSum, ColumnToSearch, Left(A2,4))
Check out the Sumifs function that allows you to set multiple search criteria. Notice that the item I searched for in the third argument is the left 4 characters of the search cell.
how about a simple solution like this:
=SUMIF($G$2:$G$999;A2&"*";$H$2:$H$999)
it sums up the data in column H, if G starts with the four digits of A.
I'm trying to make a VLookup in Excel but I get everytime a #NV error.
This is table EVENTS:
This is table TRACK:
the formula on field F2 in table EVENTS is
=SVERWEIS(E2;TRACKS!$A$2:$B$52;1;FALSCH)
SVERWEIS is the word for VLOOKUP in the German version. FALSCH means wrong
As has been mentioned, VLOOKUP (SVERWEIS) can only look to its right to find a value to correspond with a value in the left hand columns of a table. The INDEX/MATCH combination is more flexible in this respect so if not to rearrange your columns I would suggest something like:
=INDEX(A:A,MATCH(E2,B:B,0))
where TRACK is assumed to be in ColumnsA:B. Converting to German, perhaps:
=INDEX(TRACKS!A:A;VERGLEICH(E2;TRACKS!B:B;0))
VLOOKUP compares the values in the first column of your reference target, you have your target values in the second.
Just swap VLOOKUP and the TEXT columns on your TRACKS sheet and it will work just fine.
Try switching the columns in TRACKS around.
VLOOKUP bases it's lookup on the first column, so in your case, it's looking through column A (1, 2, 3, etc.)
If you want your VLOOKUP to be based on the text, it needs to be in A instead.
i.e.
| A | B |
----------------------
1 | TEXT | VLOOKUP |
2 | Text1 | 1 |
3 | Text2 | 2 |
etc...
Then your function will be:
=SVERWEIS(E2;TRACKS!$A$2:$B$52;2;FALSCH)
Switching out the third argument because you now want the value from the second column
I have two sheets in a spreadsheet. Each sheet has a first column with common values (however they are not sorted the same and they are not all there in each sheet).
What I'm trying to do, if possible, is put a formula in sheet 2, where, if column 1 is a match for sheet 1, copies selective data from certain columns in that same row in sheet 1, to certain columns in sheet 2.
Example:
Sheet 1 has a heading setup and sample data row like this:
Title | Day of Week | First | Last
Supervisor | Wednesday | Mike | Jones
Sheet 2 has a heading setup and sample data row like this:
Title | Surname | Weekday
Supervisor | (empty cell) | (empty cell)
After running the mystery formula I'm looking for, placed in the 2 empty cells above, sheet 2 should match on the Supervisor key in sheet 1 and copy in data I have specified into each column, such as:
Title | Surname | Weekday
Supervisor | Jones | Wednesday
(In this case I have told it to map the "day of week" column to weekday, and map the "last" column to "surname").
I hope this is easy/possible??? Help???
VBA is not necessary. You can use a simple VLOOKUP:
=VLOOKUP(cell to look-up,
range where you want to look up the values (first column *must* contain the keys to look-up) including all columns that you want to retrieve,
the position of the column to be retrieved relative to the first column specified in argument 2,
0 (specifies you want an exact match))
For example:
=VLOOKUP(A1, Sheet1!$A$1:$D$150, 2, 0) ' Retrieves the 2nd column matching criteria in A1
Please notice, however, that you need your keys to be unique. Matching information based on the title seems a bit odd since it is likely there will be more than one person assigned to a certain role. For example, there may be more than 1 supervisor.
Use INDEX and MATCH (better than VLOOKUP).
I suggest renaming your headers so they match on both sheet.
Sheet 1 should be :
Title | Weekday | First Name | Surname
In sheet 2, cell B2 type in
=INDEX(Sheet1!$A:$D,match($A2,Sheet1!$A:$A,0),match(B$2,Sheet1!$1:$1,0))
You can drag and drop it in column C as well, it will work since you are using two MATCH functions with the cells properly anchored.