Last row in google sheets - google-sheets

I'm sure this will be answered VERY quickly but its beginning to do my head in!
I have a stockcheck spreadsheet in Google Sheets. The stock check is done on a tablet and the data is sync'd with google sheets whereby the data from that stock check is appended in rows consecutively.
So week 1 would transfer to row 1, week 2 to row 2 etc etc etc.
The number of items on the stock check may decrease or increase to the length so consequently so the row length will do as well.
I want to transfer that raw data to a second sheet but only the last row, so I can in effect get the data from the most recent stock check.
I've tried numerous functions and can return both the number of the last row and the value of the first column in the last row.
I'm just at a complete loss in returning the values of the entire last row. Please help!

Without an example of your inventory sheet, I had to make one that is extremely simple (only has 3 columns). Next time, it would be helpful if you shared a link to your sheet (or at least made a copy of your sheet with insensitive data that you could share with us). Baring that data, I had to assume that you want the LATEST inventory row, and that you have a column with the date of the inventory in it...
Here's the sheet I created:
https://docs.google.com/spreadsheets/d/1_H73BKJJDYdJYmKz6C_qDCzQ5TaByo6PcED2nRFCDBQ/edit?usp=sharing
Basically, I created a filter in Cell A1 that gets all the columns in your range, and then returns that data filtered by all dates that are in the past, orders the array by date, and then limits the rows returned by 1 (and the columns by the number of columns in your range):
=array_constrain(sort(filter($A$4:$C,$A$4:$A<=today()),1,false),1,columns(A:C))

Related

How to expand date ranges and unpivot data to create a lookup table

I have this sheet that includes a pivoted table with a range of months in columns and years in the header row and some values in the main table. I want to be able to expand the monthly dates along with the year, id, and values to more easily use it as a look up table to find valid user ids that have a greater value than the look up value for a given year. I provided a sample sheet with limited rows as an example. The row that is highlighted yellow (row 69) makes user 2 valid within year 2022. I would then conditionally highlight the valid user.
I can get the date ranges expanded but I have trouble keeping the other data matched up with the appropriate corresponding rows. I think it would be a fairly straightforward task with apps script but I am a very inexperienced user in that regard.
Here is my sample sheet: https://docs.google.com/spreadsheets/d/1bIji78wYu32O70C2xZLn8dntyYogs5ivuNvCFj5-Z0s/edit?usp=sharing

Google Sheets formula help - total the number of X in a specific data range from another sheet

I have a spreadsheet with multiple pages. on page one i have a chart with row values of months and column values of different subjects.
i would like to have a formula that supplies a live update of all instances of X in a specific data range on page one and the data on page two. (ie: total number of times "Apple" is listed in column B for the month of august, date in column A).
of note: data is added to the top of this sheet every day, so the cells need to be dynamic
thank you for your assistance.

How to automatically add a value to sheet 3 if not found in sheet 1

can anyone tell me how to add a value to sheet number 3 if the value is not found in sheet number 1? Should I use vlookup or something? I set up a very basic google form and corresponding google sheet for a spare bus and truck parts business. I would like to add a row to sheet number 3 for every part number that comes into sheet 1 from the google form, that isn't already in sheet number 3. And if possible have the other columns in the new row update information automatically as well.
Sheet number 1 records stock coming in, and sheet number 2 records stock being used, and sheet number 3 is supposed to update inventory records by adding stock coming in and subtracting stock being used. For this, I used the sumif function but there might be a more efficient way to do this as well? =SUMIF('Parts In'!F:F,"*"&A3&"*",'Parts In'!E:E)-SUMIF('Parts Used'!E:E,"*"&A3&"*",'Parts Used'!C:C)
Thanks
Screenshot of sheet number 3

Linking a fixed spreadsheet and a moving spreadsheet by cell value

I work for a small business that depends quite a lot on the weather. I’m trying to create a spreadsheet (in google sheets) to predict daily revenue. At the moment the spreadsheet simply multiplies last year’s corresponding day by the growth percentage to get this year’s daily values. I’m trying to include the weather forecast (15 days) in the calculation. I’ve managed to import the forecast successfully using an api tutorial that I found online (https://www.visualcrossing.com/weather-data), and include the forecast values in the revenue calculation.
Now for the issue:
*the revenue prediction is a spreadsheet with every row being a day of the year, making the spreadsheet 365 rows long
*the imported forecast (in another tab, not sure that’s relevant) is only 15 rows long and updates every day, meaning that it remains that length. No new row is added during the update: the data just shift one row up and the first day disappears while a new day takes the bottom row.
My formula in the revenue tab identifies the weather data in the weather tab by row but when I pull the formula down for the whole year (down 365 rows, that is), only the first 15 rows refer to existing data in the weather tab. -> Not only are the results obtained based on the wrong row as soon as the weather tab updates on day 2, but they are also referring to totally empty cells from day 16 on.
So my questions are:
*is there a way to force the daily weather forecast to remain on its row and add a new row every day, or failing that,
*is there a way for the formula to recognize the matching day cells and use the value of the cell x columns to the right of it, effectively skipping the row referencing altogether
I’ve added a very simplified sketch of the spreadsheets for the more visual helpers out here
Apologies if this is unclear, I do not have a tech background but am happy to clarify anything if needed.
-- Edit: Here is a screenshot of the revenue tab. The expected output is in column K. The values in it at the moment are incorrect.
Seems like you just need a dynamic way to match the dates? I can't tell if you meant to have prior year data in other tab, but this spreadsheet matches your example and returns the value irrespective of the row order.
The formula being used (in the top row) is:
=B1*index(WeatherTab!B:B,match(A1,WeatherTab!A:A,))*index(WeatherTab!C:C,match(A1,WeatherTab!A:A,))

Insert row into data imported using IMPORTRANGE

I have two sheets:
SheetA contains dates. It is the reference data.
SheetB contains dates and data on events that occurred on those dates. This sheet is updated regularly.
I am using IMPORTRANGE in SheetB to pull data from SheetA.
I sometimes need to insert rows into SheetB. For example, sometimes two events occur on the same date and I need a row for each.
However, when I insert a new row into the imported data in SheetB the new row is automatically filled with IMPORTRANGE data from SheetA.
I think there may be a solution with ADDRESS but I can't figure it out. Any help would be much appreciated!
As long as IMPORTRANGE returns a single array of multiple rows you are not going to be able to split those apart at all easily. Your best bet may be to convert the array into a standard range (Ctrl+C/Ctrl+Shift+V) and start the process all over if the source changes.
You might be able to combine two ranges (one from each sheet) in a QUERY that you sort by date.

Resources