How to create a Dynamic Formula in a Google Spreadsheet based on a dropdown? - dynamic

I have a Google Spreadsheet of containing an Employee Schedule separated daily (each date has its own page). I need to create a SINGLE summary page with a drop down that will change a formula and display the results. I currently have the formulas setup so that each employee has their OWN page depending on the employee number that shows a quick summary of when they work for the entire month. I would like to compress that into a single sheet with a way to dynamically choose from a drop down what name to see.
Here's a link to the sheet: https://docs.google.com/spreadsheet/ccc?key=0Amfumj1fHXzYdElQSGtqZkZ2aHAtdW4wM1d2WTZnMXc&usp=sharing
And here's a direct link: https://docs.google.com/spreadsheet/ccc?key=0Amfumj1fHXzYdElQSGtqZkZ2aHAtdW4wM1d2WTZnMXc&usp=drive_web#gid=34
I'm Looking to change Cell A1 into a drop down that when selected will change the 744 Formulas to look for the selected name.
Current formula: =IF((COUNTIF('1'!B3:P3,"Katie"))=0,"","XX")
What i would like to accomplish: =IF((COUNTIF('1'!B3:P3,"DROP DOWN SELECTION FROM A1"))=0,"","XX")
Dropdown will always be a text name (Bob, Sally, Dave R, Adam, Kat, etc)
Any ideas?

Have you tried?
IF((COUNTIF('1'!B3:P3,'1'!$a$1))=0,"","XX")
In this way you only need to change the value cell A1 of the sheet called 1.
As for a dropbox, DATA > VALIDATION
- Range '1'!A1
- Criteria, select LIST WITH ITEMS

Related

How to color a cell based on values and date difference in another cell using VBA

Consider I have a Table A in Excel - details as below:
And another Table B as follows
I want out-put as follows,
The Name from Table B has to be checked with Name in Table A, and respective StartDate and EndDate should be picked from Table A and same should be compared with dates in Table B and cell under that name should be colored to green if Status in Table A is in "In Progress" or to Red if in "On hold"
For Example:
Consider Jack in Table B, it has 3 records in Table A, The first start date should be picked i.e 4-Apr-2017 and End date as 27-Apr-2017, and respective coloring has to be done based on status field.
How can I achieve this using VBA/anything in Excel. I'm new to VBA.
Yes you can do it in VBA but I would recommend using conditional formatting (formula) as it doesn't require programming knowledge. To do this, you will need to employ the Vlookup formula.
I believe the output you want is something in the picture link here?
To make conditional formatting, look in the "Home" tab, under Styles -> Conditional Formatting. Highlight the cell you want to format, then select Conditional Formatting -> New Rule. This will cause a new window to pop up. Select "Use a formula to determine which cells to format".
You would want 2 conditional formats.
1.To show green if the date is within the start and end date. To do so, select the first cell in the Gantt chart (cell B8 in example) then enter formula below.
=IF(AND(B$7>=VLOOKUP($A8,$A$2:$D$5,3,FALSE()),B$7<=VLOOKUP($A8,$A$2:$D$5,4,FALSE())),TRUE(),FALSE())
2.To show red when user has item beyond due date, enter formula below with same cell highlighted.
=IF(B$7>VLOOKUP($A8,$A$2:$D$5,4,FALSE()),TRUE(),FALSE())
Once that is done, you can apply the format painter or copy and paste the cell with conditional formatting to extend your table/Gantt chart.
Note that the $ signs are important as they lock the relative reference positions in the formulas. Using the second formula as an example, B$7 refers to the date and you need the reference to be locked to row 7, where all the dates are. On the other hand, the column reference (Column B) can be shifted as you want it to change to with the columns to properly compare against the other dates.
As for multiple items per user, can you expand upon your initial question? Would you like to track based on per user or per item? I am assuming that you're creating a Gantt chart to track a project. In that case, it would make more sense to track specific tasks assigned to people. You can modify the example given to track based on task.

How to reference a specific cell location within a changing table

I am not sure how, if at all, this can be done. Basically I have a report that is generated from SalesForce for some co-workers. It exports to Excel in this nice little table. Depending on their team, they filter the results and then filter the month (fiscal year in this case).
What I want to do is have text populate at the top which is based on the text that is in the first cell in the column C (not including header row of course) when they filter. How do I go about referencing the spot where C4 is currently when they select Team "White-1" and Fiscal Year "Aug"? That cell will become hidden and I will need to pull the data from C6 which HAPPENS to be in the location that C4 was just in before being hidden.
Here is an image of the report in Excel as well as the "location" that I want to reference no matter the filtering that the employee does:
Report
I assume VBA will be needed. Preferably I want to generate the text in A1
If you are ok with adding a "Helper Column" you can do the following to get the results you are wanting:
Add a column between B and C Give it a header of some kind I used "Helper". Then in this new Column use use the formula =Row() to generate a number for each row.
You can hide this column now if you want.
Then in whichever cell you want the answer you seek enter the following formula:
=Vlookup(Aggregate(5,5,C:C),C:D,2,false)
Now you can filter all you want and you should get the result you wanted.

CheckBox to limit a data validation list

Moving forward, slowly.......
I added a column, that with the combination of my checkboxes, gives the name of active employees.
Screen Shot of active list of employees
If I use $T$6:$T$16 as my validation list, I still get 11 options in the drop down. I want the drop down to show only the 5 names that are in that list.
No need to use VBA here, Here's a quick solution.
Use a 1 or 0 in a column next to the employees' names corresponding to whether they are active or not.
Then create a column in the sales sheet which has a vlookup for this value
=VLOOKUP(E4,$A$4:$B$8,2,FALSE)
This looks for value E4 (the name), in range of all names, second column for their active status, FALSE for an exact match.
Then use a filter:
Highlight range of sales
"Data" tab
"Filter"
Then you can use the filter on the new Active column to only show the employees which are still active. See the linked image for the final outcome. The vlookup lives in column D.
Final outcome image in Excel
Of course if you want this in two sheets, you can split what I've done to different sheets with no extra effort other than adding sheet references to the range in the vlookup.
Hope this helps

Excel add up values in one cell based on mutliple results from one look up value

hope you are all doing well today! I've been working on a spreadsheet that tracks invoices and the hours recorded for each one. Each invoice has multiple entries with different numbers of hours for each entry, all with the same reference number which combines the project number and the invoice number. For example, for Invoice #1 of project CZ23, the reference number would be CZ23-1. Invoice 2 would be CZ23-2, and so on. This is located in Column I, while the hours are located in Column H in a sheet named "Document Data".
Now I have another sheet that tracks the hours called "Summary". What I want to do is have cell B28 of "Summary" add up all the hours from CZ23-1 from "Document Data". Since I barely know any VBA, I don't have code but I'll display the situation here:
In this case, cell B28 on "Summary" would be 15 (all the CZ23-1 hours added up: 2+5+1+7), while B29 would be 7 (all the CZ23-2 hours added up: 4+3) and so on. It doesn't necessarily have to be B28/B29, but just as a reference I've used those cells. Thank you so much for your time - hope I was able to explain everything well.
Best way to do this would be to create a pivot table.
1. Select a cell inside your data and then on the insert tab select pivotTable.
2. A "Create PivotTable" box will pop-up. Verify that your data is captured in the Table/Range. Also, you can choose if you want to have the table appear on a new sheet or the existing sheet.
3A. In the "PivotTable Fields" box, you can drag "Reference" to the Rows box and then drag "Hours" to the Values box. This should default to Sum and should add up all the Hours by Reference.
3B. Occasionally the Values box will default to Count. To change this to SUM, you can select cell B4 or B5 (See Below). Right click and select Value Field Settings. When the "Value Field Settings" box pops-up, you can select Sum on the "Summarize Values By" tab.
It sounds like you want the sql concept of 'group by' on column 'Reference'
In excel you can do this by using pivot tables
You will find pivot tables in the toolbar at Insert-->Tables-->PivotTable

Allow text overflow despite data in adjacent cells

Is it possible to have text populate in a cell and allow it to overflow into adjacent cells even though there is data in those cells? Here is my layout and situation:
I have a worksheet that acts as a "Report" sheet which populates data based on drop down selections at the top of the report sheet. The user can select any one of 8 countries to view that specific data, and the report sheet populates cells D16 through P25. The user can also select to view all 8 countries. In this instance, country data will populate in blocks of data (D16:P25, D27:P36, D38:P47, etc.) When looking at only one country, the other cells with data are blank (the formulas return "").
I need the text overflow now because I was asked to incorporate a summary of applicable limitations below the first data table when viewing only one country in the report. For example, if the report is selected to view Belgium, the data populates in cells D16:P26. Now, I need to show in cell D18:D22 a summary of the local laws. I can incorporate the necessary text using IF statements into column D, but it is cut off because there are formulas in columns E - P currently returning no values that need to return values for the "All Countries" view.
Can this be accomplished?
I assume you use VBA to fill in the data when the user selects an element in the dropdownbox. When handling this change, you should actually clear the cells that are giving empty results, instead of having formulas in there that don't do anything useful.