I have a cell with today’s date "like cell j11", and I have a "table shifts employee" that contains the numbered beginning of the month to its end, and the table contains data. I want to design a dashboard. If today’s date is equal to the date in the table, it shows me the name of the employees at the time of shift and the data written for the day. I need the formula.
You can combine the =today() function with a =vlookup() against your table to return the correct row of what you are looking for. The formulas are displayed in the image under the relevant cells.
In this example it finds todays date, and looks up the relevant date in the table, and returns the data you want to see into F5 and G5.
Related
[Goal]
I want to be able to have a cells with formulas (such as COUNTIFS) that can change the referencing sheet range depending on the value in another cell.
[Example sheet]
To demonstrate, I've created the below example simple Spreadsheet where it has 3 different sheets. 2 with raw data (2022 Data, 2023 Data) and another with a table that will use the both sheets' raw data.
https://docs.google.com/spreadsheets/d/1Viz3SUibpaIRu77SLwLxjfcd0ZOVmHPQpu8jTdCL92I/edit?usp=sharing
Cell A2 is for selecting the date (formatted to only show the month) and cell E4 is referencing A2 to get the date/month that was selected. D4 and all month cells adjacent to each references each other to get the incremental months.
Cell range B5:E7 is using the COUNTIFS formula to count how many emails or chats were there for that month. You'll notice that the range argument is referencing as: '2022 Data'!.
What I want to do here is to create a COUNTIFS formula with a range argument that can refer to the corresponding sheet depending on the year of that column. For example for cell B5, the month is Jan 2023, I want it to refer to the 2023 Data sheet instead of 2022 Data sheet in a dynamic way.
Obviously, I could add another COUNTIFS so that it can take 2023 Data sheet's data into consideration, however, I'd have to change the formula every time it's a new year.
Using the QUERY function as an example, I know that you can refer to a cell within the string argument if you use the double quotation and the ampersand symbol (example: "&H1&") to get out of the string. I tried doing something similar (example: '"&B4&" Data'!) but nothing worked.
[Question]
Is there somehow where I could potentially change the cell referring range dynamically depending on the value of another cell?
you can use INDIRECT:
=COUNTIFS(INDIRECT("202"&RIGHT(B4, 1)&" Data!A:A"),B4)
I have a sheet called "Orders" in which I add each order, its date and amount.
In a separate sheet, I have a monthly summary table.
I want a cell in the summary table to look at the "Orders" sheet, and if the date (in Orders, row G) falls between Jan 1 and Jan 31, I want the total from Orders, column AE to show in the summary table. I'll do this for each month.
This is what I have so far:
=SUMIF(VLOOKUP(AE4:AE5,'Orders'!G4:G5,">=1-Jan-2021″,G4:G5,”<=31-Jan-2021″),0)
Obviously that isn't right (I'm just playing around and don't really know what I'm doing!), but maybe I'm getting close.
Note that new rows (i.e., orders) will be added to the Orders sheet throughout the year, so I want AE5 and G5 in the formula to update automatically as I add a new row.
Any help much appreciated.
Here's one method, which requires a few more columns but isn't terrible. You could probably shorten this a little, but if you're in a pinch then it works.
In your orders sheet, add two more columns titled "Month" and "Year".
Month Formula (which extracts the numeric month from your date):
Cell C2: =MONTH(B2)
Year Formula (which extracts the numeric year from your date):
Cell D2: =YEAR(B2)
Then in your summary data, you create a SUMIFs formula. Picture below.
Cell K2: =SUMIFS(E:E,C:C,I2,D:D,J2)
If I've not misunderstood your requirement then sumifs (plural) itself can help out,
Conveniently you can have a named range "total" for the column G and "date" for column AE of the orders sheet
If you want to add dates greater than 1st of Dec and less than 5th of Dec then in the cell of the summary sheet you can add
SUMIFS(total,date,">=1/12/20",date,"<5/12/20")
I'm having some problems visualizing what your spreadsheet looks like, but assuming the dates you are checking against are in column G and your totals are in column AE, I think the following would work:
=SUMIFS(AE1:AE1000;G1:G1000;"<="&DATE(2020;1;31);G1:G1000;">="&DATE(2020;1;1))
If I wanted to make this formula to autoexpand as I added more rows to the table, I'd change my data into an actual table, and refer to the ranges by their headers. Or you can just do what I've done here, and set a range that is significantly larger than what you are likely to use and hope you never add any entries outside of it.
Okay, found it! The formula that has worked is
=SUMIFS(Orders!$AE4:$AE5,Orders!$G4:$G5,">=1/1/21",Orders!$G4:$G5,"<=1/31/21")
Thanks for all your help!
How can I highlight cells in Google Sheets if current month?
The cells have Jan-2017, Feb-2017 etc. and not dates.
I just want the current month highlighted so that the rest of the team can keep track of our monthly stats.
I'm supposing the column that has the months is A, and that the actual values of each cell is the first day of each month (so 2/1/2017 for February for example).
Select where you want the conditional formating to go, and open the conditional formatting sidebar.
Choose "Custom Formula" from the dropdown, and paste the following in:
=$A:$A=(today()-day(today())+1)
What we are doing here is:
=A$:A$ - Look in column A for the following
today() get todays date
-day(today()) get the day and subtract it from the today in the previous point
+1 add 1 to the result because 2/8/2017 - 8 = 2/0/2017, which google sheets actually recognizes as 1/31/2017, so by adding 1 it will become 2/1/2017 which is what is wanted.
The result of this sum is then compared to the data found in A$:A$ and the results which match the sum (today()-day(today())+1) are highlighted.
Just for the record, this may work as well using conditional formatting's custom formula:
=month($A:$A)=month(today())
Considering the dates are in the column A
I have two sheets in same workbook. Sheet1 is having the data to be updated and sheet2 is having the data after the update. I want to highlight the errors in Sheet2, with comments beside the cell "E" as Wrong Date Entered. I have tried using VLOOKUP formula but it did not work.
Formula Used: =IFERROR(VLOOKUP(E3,ti,5,FALSE),"Wrong Date Entered")
You could retrieve the date from Sheet1 with a multiple field criteria (using IFERROR to retrieve the new entries) and compare the dates.
The formula in SHeet2!F2 is,
=IF(E2=IFERROR(INDEX(Sheet1!$E$2:$E$9,MIN(INDEX(ROW($1:$8)+((Sheet1!$A$2:$A$9<>A2)+(Sheet1!$B$2:$B$9<>B2)+(Sheet1!$C$2:$C$9<>C2)+(Sheet1!$D$2:$D$9<>D2))*1E+99,,))), E2),"", "Wrong Date Entered")
Fill down as necessary. When transcribing for your own purposes, remember that ROW(1:8) is the position within Sheet1!E2:E9, not the actual row on the worksheet.
EDIT:
I opened up the Sheet1 ranges to look at 9999 rows then filtered for the error message and came up with the following.
The formula with the larger cell ranges I used was,
=IF(E2=IFERROR(INDEX(Sheet1!$E$2:$E$9999,MIN(INDEX(ROW($1:$9998)+((Sheet1!$A$2:$A$9999<>A2)+(Sheet1!$B$2:$B$9999<>B2)+(Sheet1!$C$2:$C$9999<>C2)+(Sheet1!$D$2:$D$9999<>D2))*1E+99,,))), E2),"", "Wrong Date Entered")
When filling the formula down it did take a few seconds to calculate but I'm only using an older business class laptop so I don't think that the calculation lag was anything completely out of the acceptable range.
You can save both files as pdfs and can compare those files using Acrobat Pro.
Goto View -> Compare Documents..
I have a google spreadsheet with 2 sheets. The first sheet contains data that has been input by a form. Each form response will input data for the following "Timestamp", "Zone", "NPC", "Faction", "Amount", "Faction2", "Amount2", "Faction3", "Amount3", "Faction4", "Amount4", "Faction5", "Amount5".
Row 1 contains the above category names for each response input. The way the form works unfortunately is that each response is put into it's own column based on what Zone is chosen at the beginning as each Zone has different possible responses for the category. So the data is spread out from Columns C to Columns HC. Each row will only have one response per category name, but the category names are repeated and spread out.
I have been using the following query in Sheet2 to pull the information from whichever "Zone" that is selected from the E1 dropdown in the sheet.
=if(len(E1)=0,"Please Select a Zone in E1",query('Form Responses'!A2:IS,"Select * Where B = """&E1&""" "))
The problem is that it returns the entire Row for the Selected zone so the following information doesn't line up. Is there any way for me to return only the information from the Rows that have data in the cell. This would then line up the data into the correct Column for Sheet2
Below is a link to the Form with some sample data in it, the Cobalt Scar selection lines up as the responses are in the corresponding columns in the data sheet, but Crystal Caverns and Western Wastes do not. You can change selected zone to view the results in Sheet2 E1.
Also the sheet is a copy and can be edited by the public.
https://docs.google.com/spreadsheet/ccc?key=0AqEFpZnTydP-dFNNOV9sRzNRSldDUXRJX1pqSFZRYkE&usp=sharing
I haven't found an elegant solution to this type of problem, but that doesn't mean it's not solvable.
The solution I created on your sheets is easily manageable (only have to update the sheet with the area / column table), but it does take up a little more memory.
How it works:
The ArrangedData tab is the first 2 columns from Form Responses, then the "appropriate" columns (based on the selection made on sheet2; it picks the columns from a lookup on sheet5).
Then ArrangedData is filtered (based on the selection on sheet2 again) into sheet2.
Let me know if you have any questions about it.