I'm trying to create an organizer to my payments sheet, it's a sheet that receives all payments and I want to show only the last payment for each user, I want do this to know how much time user stay with us!
I don't have idea how to do it, I'm trying use UNIQUE but this doesn't work fine!
Can you help me?
Demo sheet: https://docs.google.com/spreadsheets/d/169FgYI4v43WnFhAlcfrXnOtzvBKMNbQBvGsQ7W41HcE/edit?usp=sharing
I've set up a new sheet called "Erik Help" with this formula in F1 (highlighted bright green):
=ArrayFormula({"Client name"\"Payment date";VLOOKUP(UNIQUE(FILTER(B2:B;B2:B<>""));SORT(B2:C;2;0);{1\2};FALSE)})
You can see that the formula generates the headers first.
Underneath that, the unique list of clients ...
UNIQUE(FILTER(B2:B;B2:B<>""))
... is looked up within a SORT of the client and payment data, sorted descending by date (which leaves the most recent dates at the top and working down).
The virtual range {1\2} is returned, which is each name and date from the UNIQUE list.
Since VLOOKUP only returns the first match it finds (if any), you'll always get the most recent date per client.
I am not sure where is the data I should use within your sheet. So let's work on dummy table (it's in your spreadsheet as sheet 'Dummy'):
First I take a list of transaction and get unique client names:
=unique(B2:B)
Then I use vlookup formula to search for the first appearance of the client on payment list.
Ifna is used to hide error messages
Arrayformula makes vlookup possible to work on whole column without copying.
=ArrayFormula(ifna(vlookup(G2:G;$B$2:$C;2;true)))
Related
I have a google sheet that contains rows in sorted order based on a date column. Now I want to highlight the row(make it bold) which is nearest to the current date but not greater than it, i.e., today>=max (dates where date <= current date). Can someone please help me out on how to achieve this?
--Update--
I have solved the problem by moving the expression to another cell and then referencing the cell in the conditional formatting from there. Now I have a new problem, I want to generate one cell's value and make that non-editable. In simple words, I want to generate create date of a row and put that date in a column named create date. I think I have to use the google apps script but not sure if the idea of putting a system-generated date in a column is feasible.
I think I know the answer to this, and it's no, but I thought I'd give it a whirl.
I have a spreadsheet that is populated -- based on user requests -- with a pair of FILTER functions, as follows:
In cell H6:
=iferror(filter('Imported primary list'!A6:C,'Imported primary list'!D6:D="LastName"),"None")
...and in cell K6:
=iferror(filter('Imported primary list'!E6:E,'Imported primary list'!D6:D="LastName"),"None")
Where LastName is the name of the person who generated the request, from another tab. This is going into columns H, I, & J on the filtered page (and column K with the second filter). Then, the user enters time info in column L.
The problem:
Because the filter function is pulling from an alphabetical list, every time the user selects another row to include, it resorts the list to include the new row, alphabetically. However, the timestamp entered by the user in Column L remains static. Thus, the rows are now misaligned.
The obvious solution is to tell users not to enter times until they're sure that there aren't new requests to make. However, that's not always feasible. I also can't have the users enter everything on the Imported primary list tab.
So, is there a way to move the text in column L to keep it with the filtered data from columns H-K? I think it would have to be a script, not a function, but I don't want something that would add too much processing. I think the answer is no, and users will just have to manually adjust their data, but I promised the user I'd ask.
the sheet I'm working on generates a request number on the very first submission a user makes of a google form based off of information the user inputted in the form and a timestamp. Now, because I need for the user to be able to edit their response later which causes the form to be re-submitted, I want the request number not to be regenerated, and to stay the same as when it was initially generated. Is there any way to prevent a cell from changing from its initial value when it contains a formula that references a cell that updates?
Here is the formula contained in the cell I don't want to update with alongside its references:
=ARRAYFORMULA(ARRAY_CONSTRAIN(if(ROW(A:A)=1, "Request ID", if(D1:D="", "",C1:C&"-"&G1:G&"-"&N1:N)), MAX(if(D1:D="",0,ROW(D1:D)))-ROW()+1,1))
The formula appends different values received from the form together to create a request number (formatted as essentially C1:C-G1:G-N1:N, timestamp-System-initials) and the arrayformula and constraint ensures the formula is copied to each row in the sheet that contains a form response so far. I want this request number to stay the same as it's initial value, even as columns C, G, and N change.
Edit: Not really sure how I can provide a search history on what I've tried so far because I've been searching for anything I can to fix this problem because it's important. I've looked into indirect referencing, absolute references, considered using PropertiesService (Google Apps Script) in order to store whether the request number has been initiated before and got stuck there, considered copying the value into another column to store it but again the autoupdating feature that accompanies linking cells of course still remains an issue. I'm stuck on what kind of function/workaround I could use to achieve this. Look forward to your thoughts. I've also tried a number of other strategies as well.
Since formulas recalculate each time the spreadsheet is recalculated using a formula is not the right way to keep the original value on the current spreadsheet version. The way to achieve this is by using a script to log those values.
There are already a lot of questions about using a script to log values from one sheet to another. Here are few examples
How to Get (& Set) cell values from one sheet to another in Google Sheets?
I want to write a script to read and log values of a specific row and copy them to a new sheet
I have a spreadsheet which lists the data of 2,000 people from multiple databases.
My spreadsheet lists duplicate email addresses because for example - they may have given their personal address in one database and their personal and work address in another database.
Each person has a row, and I have 6 columns with email addresses. I need to keep only unique email addresses for each person and remove duplicates. Does anyone know how to do this? I have tried removing duplicates, conditional formatting, advanced filter and none of these things seem to suit this scenario.
example data
Copy the following formula to cell H2 in your exemple, then drag it to column M and all the way down.
=IF(COUNTIF($B2:B2,"="&B2)<2,B2,"FALSE")
This will create a copy of your original 6 columns (at H-M), with all duplicates or empty cells replaced by "FALSE". Afterward do copy&paste values, and there you go.
Explanation:
for each target cell we check the value of the cell 6 columns to the left (H2-->B2).
The countif range is column B to the examined cell (included), in the same row.
if the examined value appears only once in the range (itself), it's being copied to the target cell, otherwise we set FALSE.
I have simple google spreadsheet with two sheets: sheet1 and sheet2. In sheet2 there are time values in column A which I am trying to copy to column A in sheet2. I wrote a script(please see link) for it but values are not the same. What class/method do I need to use in order to get same values in both sheets.
I noticed if I format column A values in sheet2 to text than I get matching values but problem is I am not allowed to that and that column must remain formatted as time.
Also, my second question(please ignore if its off topic). If I have work schedule in google sheet for 3 employees: John,Peter and Mike and they all have editing permissions. If Mike decides to use filter to filter out just his work schedule, is it possible for other two employees to have unedited sheet(as I believe Mike's actions will affect other two persons). What I mean is, is it possible to restrict one persons actions just to view he is looking at while other have unaffected version(together work schedule in this case)?
link for spreadsheet:
https://docs.google.com/spreadsheets/d/1tOtwzM0CxDHBXzC8ECeXlfaTGC4i7rH2XMYYszqRINM/edit?usp=sharing
Much appreciated.
not entirely sure what the problem is, your script is working as intended and you have the same values in sheet1 as in sheet2. The only difference is that in Sheet1 you have a date format and on sheet2 you only indicate the time. I have changed the number format in the sheet1 and as you can see it's the same.
The problem you are having is that by indicating only the time, you let the sheet assume any date. For time it's not that big a deal, but you must be sure that time formats are the same. use getNumberFormat() and setNumberFormat() (read here) to set the correct formats when copying or have the formatting set in advance
As for filtering — you can simply give them view-only access and let them use filtere views (right under "Filter"). A filter will hide information for everyone on the sheet, while a filter view will only be visible to that person. You can also pre-set filter views for them as those with edit access can save filter views.