How to count the number of date-specific newly data entered on an increasing range from row x? - range

I need formulas that do these things for me automatically
Count and display the number of new pieces of data added to the spreadsheet =TODAY()
On a separate sheet, list the number of new pieces of data added to the main sheet each day
Count the average number of pieces of content added to the spreadsheet in a given month
The challenge for me here is that every new data is being inserted on the top row of the spreadsheet just below the header so the start of the range changes every time. Is there a way to permanently include in the range all the newly inserted rows below the header? Here's the link to the spreadsheet

use in cell H1:
={COUNTIF(INDIRECT("D4:D"), TODAY());ARRAYFORMULA(COUNTIFS(
INDIRECT("B4:B"), "content", MONTH(
INDIRECT("D4:D")), MONTH(TODAY()))/COUNTIFS(MONTH(
INDIRECT("D4:D")), MONTH(TODAY())))}

Related

Match date and schedule to find employee working on a certain date - Google Spreadsheet

I have a table with the schedule of the employees
enter image description here
The first column contain the names of the employees, the 3 row contains the date, and the table contains the different positions they work on.
I want to extract the employee working on each particular date at different positions, "Д", "ДК", "1", "Дел1" and so on.
enter image description here
I tried playing around and I managed to get the column number based on the date in the cell next to Date. But I am not able to use the column number inside formulas to do a vertical lookup and find the row number.

setFormulaArray too slow

I'm trying to write a python wrapper which is designed to read multiple records from csv(or mysql) and update values of a predefined range of a sheet, the range is consisted of value cells and formula cells, my purpose is to update value cells only and keep formula cells in the range unchanged.
In order to do this, I first tried setting cell values one by one, using if to skip formula cells, but it was to slow because there were more than 10 thousand cells, then I tried setDataArray which was fast enough but formulas were overrode by values, then I created an array and set values and formulas into the array and used setFormulaArray to put the values and formulas into the range, the function was what I needed, by it took more than one minutes to finish
I know the setFormulaArray will update the formulas but I don't need this to happen, however as there is no option in the API to skip formulas I can only use the same formula to update the original formula in a certain cell.
Is there any solution to improve the performance when using setFormulaArry, or is there any solution to update only value cells and skip formula cells in a range?
bellow is my code
import uno
import time
#to open the libreoffice calc file
local_ctx = uno.getComponentContext()
smgr_local = local_ctx.ServiceManager
resolver = smgr_local.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local_ctx)
url = "uno:socket,host=localhost,port=2083,tcpNoDalay=1;urp;StarOffice.ComponentContext"
uno_ctx = resolver.resolve(url)
uno_smgr = uno_ctx.ServiceManager
desktop = uno_smgr.createInstanceWithContext("com.sun.star.frame.Desktop", uno_ctx )
PropertyValue = uno.getClass('com.sun.star.beans.PropertyValue')
inProps = PropertyValue( "Hidden" , 0 , True, 0 )
document = desktop.loadComponentFromURL("file:///D:/salse.ods", "_blank", 0, inProps )
# get the sheet and read original data and formula from the sheet
sheets = document.getSheets()
xs = sheets["salse"]
cursor=xs.createCursor()
cursor.gotoStartOfUsedArea(False)
cursor.gotoEndOfUsedArea(True)
cra=cursor.getRangeAddress()
rng=xs.getCellRangeByPosition(cra.StartColumn,cra.StartRow,cra.EndColumn,cra.EndRow)
ft=rng.getFormulaArray()
#some code here to change values in ft....
# bellow took more than one minutes
rng.setFormulaArray(ft)
it is only a test of setFormulaArray performance
update1:
I still can't find the ideal solution,however, my solution is to create an identical sheet for each of the sheets in the workbook and add ,in the original sheets, references to the newly created sheets on the precisely same cells, for example:
example
sheetA is the original sheet
sheetA-1 is newly created one
then modify data cells in sheetA to reference to sheetA-1
then setDataArray to update the entire range in sheetA-1, data will automatically change in corresponding cells in sheetA

Tableau - add row without making it a subset of previous row

I want to add rows to a Tableau text table without making the row a subset of the previous row. Using the example below, I want values for teams and status to display on separate rows rather than status appearing as a subset of team. I also want to add a team filter so that if I filter on team blue, values for green row are zero and status values update . Is this possible? I tried creating separate worksheets but keeping things aligned is problematic.
Example Data:
Desired text table:
What I don't want:
Select both the fields(team, status) simultaneously then right click and go to Transform > Pivot.
Then 2 Dimensions will be created. Drag the Pivot Field Values on to Rows section
and Year on to Columns section and keep Year in Discrete format.
Then drag Number of Records on to value field section.
Before Pivot:
After Pivot and final viz:

Google Sheet: Pick max date out of row

Assume: in a google sheet the attendance to courses is logged with crosses.
Goal is to get the last attendance date of a person and add 6 months to it. ( course needs to be followed every six months ).
I've tried to retrieve the date of the last course in one column and add the +6months immediately and tried to have the +6 months in the second column, but I didn't succeed in both attempts.
See this link for example google sheet: https://docs.google.com/spreadsheets/d/10DG2I4VgTlOHJ5TG0qH4pJ5hJ9zsYuJCgRzEtuiTE60/edit?usp=sharing
=lookup("x",$B4:$F4,B$2:F$2)
Enter this formula in cell G4 and copy down the rows.
This formula looks for "x" (the attendance indicator) in cells in row 4 (columns B to F) - it's looking for the last instance. Then it returns the cell value from row 2 (the course date) of the relevant column.
=EDATE(G4, 6)
Enter this formula in cell H4, and copy down the rows.
This is pretty straightforward. It takes the date obtained from the lookup formula and adds 6 months.
Note that the lookup formula references column F. That's because as you create more courses you'll want the formula to automatically include them. So in cell F1, type something like "Don't use this column" - and then don't use that column!
Now when you add a new course, insert a new column to the left of the column headed "Don't use this column". This will ensure that the range in the lookup formula will expand to include the new column/course, and your latest attendance date will be updated automatically.
BTW, there's no guarantee that the date of the next course is a working day.

How do I find data against a date for an item from another work sheet

How do I find data against a date for an item from another work sheet. I am unable to use vlookup or Hlookup as that Item number has multiple number of data for different week date. For eg on the first sheet I have item ABC and I want data for that same item against date 01/13/2014 and 01/20/2014 from another sheet. How do I Pull exact cell data for that item.
This is how i got this working.
=INDEX(Sheet2!A$1:H$9,MATCH(A2,Sheet2!A$1:A$9,0),MATCH(B2,Sheet2!A$1:H$1,0))
The idea is to match the index by matching the intersection of your item number in row and your week date in column in sheet2. You would get #N/A as well but ignore those.
Hope this helps. Enjoy!!!