I am trying to find the latest status of a project using Arrayformula…
Gsheet structure :
[Project] tab with all my ongoing projects (name {in column A}, launch date, comments…)
[Status] tab which tracks the successive status of each project (project name {in column D}, status, date {in column G}, comments…)
Used formula :
I am trying a Max(If()) formula to retrieve the latest “status date” of a project (I will find a way to retrieve the related status with it) :
=ARRAYFORMULA(max(if(STATUS!D:D=PROJECT!A2,STATUS!G:G,0)))
It actually sends me back the last “status date” of the first project for all my projects
Any recommendation on what’s going wrong? I have unsuccessfully tried a Google search and I am out of options right now…
Ok this one is really impressive and I think I won’t even try to understand it
“Curiously”, it works perfectly
However, I need the formula to replicate automatically to any new line (meaning any new project in my app) which can be created thanks to a “form button” in my app. This is why I was trying an Arrayformula. Can you confirm that the “Lookup(2,1/…)” formula won’t replicate?
Thanks for the insight. I can’t copy thee app to check of the formula works, but I understand that you are able to duplicate the formula thanks to the form button?
Hello @ionamol and thanks for the input! I’ll check if I can do something with Array_Constraint which I kind of forgot
Vlookup can’t work for me as I have 2 criterion for my “lookup” : the project name and the latest date.
Maybe I could use a sort formula in order to sort in “date descending order” all the project status, and then use your Vlookup formula… I’ll let you know if I succeed by tomorrow (kids are back from school! )
@ionamol Doesn’t array contraint get thrown off if you have empty rows? I thought I read somewhere that empty rows caused issues, but maybe it had to do with the type of formula used inside of it. I’ve never used it, but I’ll have to play around with it sometime.
@Clement I tried what you mentioned and it looks like you can use a formula like this =ARRAYFORMULA(VLOOKUP(A2:A, SORT(A2:C, C2:C, false), 3, false)) . What it’s doing is using the SORT to sort the data by date in decending order. Then uses the VLOOKUP to return the first record that matches the project name (first match will be last date for that project because of the sort).
it works !
It just required to switch the colums in order to have the “date” column between the “project ID” and the “satus” ones
Many thanks for all your inputs