I been doing a sheet to resume my statistics for every month, and i got a problem with the table that was supposed to import the values of each day of a month in the table varying for the month that is "selected".
I got 12 sheets that each one has 31 days to complete manually. The resume needs to catch the info for each day on the specified table.
So i got the tables in every sheet defined with janWeight, fevWeight, marWeight And goes on. In the resume i have a table that verify the Insert in a specific cell that define the month that i am looking for.
I need a formula that can do the reference to the specified table. Like if the cell for the month is "3" i'am looking for the table marWeight, and them i can do the import of all the information.
I really can pass thru this problem importing every single value of the sheets by copying them using =COUNTIF() but this would generate a table with 2,232 cells, and that's not worth at all.
Thanks.
There's a lot of vba codes that work alongside of objects such as tables. Since they're named I'll give some basic calls, but you can read more about Table and VBA here This source has helped me teach myself VBA and I found it very helpful.
You can change the sheet from Activesheet to a specific one if it better suits your code.
Table = ActiveSheet.ListObjects("janWeight").ListColumns("Column 1").Index Would be how you reference the column named "Column 1" in your data for example. It works from the name, but you can change this as well to be the actual column number rather than a name. Just make sure to declare variables correctly as well.
Related
I am currently working on a database (that's why I needed to blur some cells.) and I want to copy some data from the first sheet according to the graduation status. We are planning to use this database for next years too, so I want it to copy the data automatically when someone adds information. I wrote a formula for this, it is copying the data as I want but it cant skip the false condition; as it can be seen, the 8-9-16-17th row in General Sheet is copied to Student Sheet.
I saw another problem like mine and tried to implement the formula in my sheet but I couldn't make it work.
The problem that another person was dealing with: Get cell value but skip row if wrong
The formula I found and tried to implement in my Excel book: =IFERROR(SMALL(IF(($B$2:$B$15="Denied"),$A$2:$A$15,""),ROW()-2),"")
The formula I used in my Excel book: =IF(GENERAL!E3 = "Student";Table1[#Name];"")
With Excel 365 you can use the Filter() function. In the sreenshot I used
=FILTER(A:C,B:B="student")
Be aware, though, that with any formula solution, the result will be dynamically recalculated, so if you are planning on adding any data to the filtered table, these manual data entries will become a problem when the formula updates and the previous results occupy different positions.
If your goal is to get a one-time copy of all the non-graduated Students in Sheet A, you could just sort the sheet by the status column and copy/paste the desired data into a new sheet. That pasted data will not change and you can make manual edits.
Short question: Is there a way to get a formula that references a column in an Excel table to always refer to only the column with that name? This is a straight-up formula question, not VBA-related.
Formula:
=COUNTIFS(Table35[[dc]:[dc]],$A6)
In this case column A has a data center name in it. Table 35 is the output of another program that produces data for an ETL and also most of the same data for this spreadsheet that is used for both analysis and status reporting.
Problem
Due to the nature of analysis, the shape of the data changes. It seems like about once a week there is another variable (column) that needs to be added to the ETL and analysis. I've simply been copying the program output, going to the upper left hand of the table and pasting. For all of my PivotTable analysis of this data it works exactly the way I want it to.
The problem happens to my dashboard built with various Countifs() formulas like the one above. My initial expectation of behavior is that by referencing the data (first by column name and now as a range of columns that contain only one column of data) that Countifs() would select the data based on column header value (much like using vlookup() + match() together).
Instead what happens is that when a column gets added the names in all of my formulas change. It appears the internal representation essentially says I want column #N. No matter what data happens to be in column N, that is what shows up. So for example, [dc] above turns into [CS Windows Error Message]
Is there any way to indicate that I want the column named "dc" regardless of where in the table dc is located? Even the great and omniscient Google has failed me on this one. Help appreciated.
Try wrapping the table reference into the Indirect function. That will preserve the column name and return the correct value.
=COUNTIFS(INDIRECT("Table1[dc]"),2)
or, with your formula
=COUNTIFS(INDIRECT("Table35[[dc]:[dc]]"),$A6)
I have a workbook with the below tabs.
- Tracking (REV)
- Resource Data
At the beginning of the REV Spreadsheet I have Ref.# that are the same across each sheet, but I do not bring across all the columns from the Resource Data tab into the REV tab. However for the columns I do bring across, this means that if I sort data, the formula's are always going to be looking for the unique Ref ID before anything else.
What I am trying to do...
At the bottom of the REV sheet I am trying to sum the monthly columns if when looking up the reference ID on the Resource Data sheet, it runs a true/false against each row by looking at the project name and matching that to a referenced cell with the project name on the REV tab.
The workaround for the time being is to add the Project Name column into the REV spreadsheet, but then I need to go change all my vba code for the generation of these complex workbooks.
I have tried using a SUMIF in combination with INDEX MATCH.
=SUMIF(Tracking_REV[Ref.
'#],INDEX(ResourceData,MATCH('Tracking (REV)'!A4,ResourceData[Ref.
'#],0),10),Tracking_REV[Feb-19
(Actual)
Calendar])
I'm expecting to be able to sum the range as descriped above, without having to add a column into the sheet.
Resource Data Sheet
Tracking (REV) Sheet
From my understanding, the criteria for you to look up the sales are the reference number and project name. You cannot simply look up the figure using the reference number.
If that's the case you properly need to show Project Name on the REV sheet.
I am not sure how adding a column would impact your VBA. If you can specify this then I may be able to give you a better answer.
For now my suggestion would be adding the Project Name as a new column at the end of your REV report which may not have impact on your pre-written VBA code.
Alternatively replace a current column on your REV sheet which is not important with Project Name so it dose not change the size of your report which might not affect your VBA.
If not please give more details regarding your VBA code.
I will have a defined number of identical workbooks within excel for each member of staff, at present this is 3. I want to have a master workbook where I can consolidate the data from all 3 workbooks. If there was a defined number of inputs I could obviously just copy and paste the data over or use a macro to make it seem more 'live'. However, it will be unknown how many inputs each member of staff will have and the only way I could imagine doing it is by the following equation (however I would use the workbook reference):
=IF(Sheet1!A1<>"",Sheet1!A1,IF(Sheet2!A1<>"",Sheet2!A1,IF(Sheet3!A1<>"",Sheet3!A1,0)))
However, when you drag the formula down it will give the obvious problem of putting the value of Sheet2!B13 in the 13th cell if there were only 12 inputs in SheetA, I would need to know the final value of the first sheet to reference the second sheet - but they are dynamic.
Any help would be appreciated.
If you want to find the last row of an area by a formula in Excel;
You need Table:
Select your area.
Click on Formats as Table from Home→Styles, and select one of then
Now you have DESIGN tab that you can see the Table Name like Table1.
Now, you have a table and by this formula you can find number of rows of your table:
=ROWS(Table1)
And by this formula you can find number of columns of your table:
=COLUMNS(Table1)
And when you want to know its value try this (The final value):
=INDIRECT(T(ADDRESS(ROWS(Table1)+1; COLUMNS(Table1)))
NOTE : By using Tables you Don't need to specify your sheet.
I am having some difficulty writing a specific Excel formula. I have a summary sheet that pulls data from various other sheets extracted from a database. One of these is a PivotTable whereby using the Item Number in the first column and the dates along the top row as a reference I can pinpoint the data I need. eg:
To address the highlighted cell I would normally manually write:
=GETPIVOTDATA(HighPiv,"SPN010977-204 11333")
HighPiv is the name I gave to the pivot table as I am referring to it from my summary sheet.
This works, however the Week numbers along the top will continuously be changing in the pivot every month and therefore this formula will not pick up the values accurately once the pivot is updated. I have been looking into a way to make the referencing more dynamic. This is the summary where the data is required:
Rather than within the quotation marks of the formula (adding the specific Item number and Week number word for word), I was hoping to refer to the cell references of the summary sheet. (So if I wanted Item number, say A55, and Week number, say H50). The dates in the summary sheet change according to the pivot so referring to the dates on the summaries to get the data would be a better way for it to be kept up-to-date.
The problem here is I don't know how to go about it. I have tired to refer to the cells in question but it doesn't seem to work giving me #REF! or #VALUE! errors.
I think what you would like is:
=GETPIVOTDATA("Qty",HighPiv,"Item",A55,"Week",H50)
I find the easiest way to write such a formula is to start by ensuring that Pivot Table Tools > Options > PivotTable – Options, Generate GetPivotData is checked then in the desired cell enter = and select the required entry from the PT (here63). That would show (for example) “SPN010977-204” and 11333 or ”11333” but these can be changed to A55 and H50.