google sheets (h)lookup last non-null value in specific column - google-sheets

I'm trying to populate a column with the last known price at the end of a batch of orders.
Please see an example attached.
I need the last price known from columns "price". Please note that there is not always value.
I tried something like this : =LOOKUP(B2:H2,"price",B3:H3<>"")
But it didn't really work.
(the nos 18 and 3 in column "I" are just examples. I need the green 3 results),thx.

Maybe try:
=INDEX(FILTER(B3:H3,B$2:H$2="price"),COUNTIFS(B$2:H$2,"price",B3:H3,"<>"))
If there could be empty gaps in your data, try this alternative:
=INDEX(A3:H3,MAX(COLUMN(A3:H3)*(A$2:H$2="price")*(A3:H3<>"")))

Related

COUNTIF with IMPORTRANGE result keep showing only 0 or 1? WHY?

I have one spreadheet that includes name, id and amount of numbers data in it and i want to make the report in other spreadsheet.
i want to count the name column that is not blank, so i type this
=COUNTIF(importrange("gsheet link","Payroll 16-31 Jan!B3:B"),"<>")
but the result is "1" in fact that there are 3670 names on the column
=COUNTIF(importrange("gsheet link","Payroll 16-31 Jan!B3:B"),"<>"&"")
but still not working
can someone help?
I want to get the exact calculation of those data
Two things: have you connected the spreadsheets? If not, use IMPORTRANGE outside COUNTIF, something like =importrange("gsheet link","A1") . Accept the permissions and see if COUNTIF now does it right
If it doesn't, try with COUNTA that is specifically defined for counting non blank cells:. =COUNTA(importrange("gsheet link","Payroll 16-31 Jan!B3:B"))

Removing ColumnA from ColumnB, then presenting the results in ColumnC in Google Sheets

I have a Google Sheet with two columns: SetA and SetB. SetA contains values that must be removed from SetB, so that what I am left with is SetC, which contains ONLY values that are unique to SetB.
Here is a copy of the file I've been beating my head against for the past few hours:https://docs.google.com/spreadsheets/d/1Qq8EAPMTrvOiGnIS-cFk2y13KNt7nBahcbflrm-cPmg/edit#gid=0
Note that all my attempts have failed so far because Google Sheets wants to compare based on rows instead of columns. It looks at A:2, and if doesn't match B:2, it marks the value as "unique", without bothering to see if A:2's value appears elsewhere in B. If "12345" is in Row 1 of SetA, and in row 3,456 of SetB, it still needs to be removed from SetB.
Background: SetA is a list of "good" product codes. SetB is a list of ALL product codes. I need to indentify the bad codes, and the only way to do that is to remove the "Good" list from the "Master" list, which will leave me with a "Bad" list. Thanks in advance!
I tried to compare the data using =UNIQUE(A2:B54341) but all that didn't work, it just echoed the same data. I was expecting to see a column with only the values from SetB that were NOT in SetA.
Little bit simpler approach.
=UNIQUE(FILTER(B2:B,INDEX(COUNTIFS(A2:A,B2:B)=0)))
To remove blank rows from Column B.
=UNIQUE(FILTER(B2:B,B2:B<>"",INDEX(COUNTIFS(A2:A,B2:B)=0)))
You can try with this formula that finds with BYROW if there is a match in A or not:
=FILTER(unique(B2:B),BYROW(UNIQUE(B2:B),LAMBDA(each,IFERROR(MATCH(each,A2:A,0)=0,TRUE))))

Pick the first duplicat value ($R$4:$R) based on each of them must be have high number on column ($T$4:$T) with arrayformula

I want to make a duplicat value which are refferance from ($R$4:$R) column. Based on each have a highest number of them on column of ($T$4:$T) as a criteria and want to do this all with arrayformula.
I've tried my formula on "T E S T" column on (AE3) but it doesn't gave me the rights output as I want as I imagine it.
See the pic I atteched here below :
And my gsheet's doc please feel free to edit because I hope that you will. It makes me happy ^_^ :
Example link
Try this formula. It seems to work in Column AF
=filter(If(IFERROR(match(R4:R,R:R,0),0)=ROW(R4:R),R4:R,""),R4:R<>"")

Adding values based on other values but SUMIF is quite right

Here is a link to my spreadsheet. Essentially what I am looking for is if the task matches then I want to also be able to give a Tech level then from there add up the values. I put a note in the sheet but basically if I give a task value and a tech level I want the corresponding value but whenever I try to do multicolumn adding in my sumif it just gives me the value from the first column.
An example of the formula I want is something like =SUMIF(Name, Name2 and Rank, Add Values).
try:
=INDEX(IFNA(VLOOKUP(K3:K&"♥"&L3:L, SPLIT(FLATTEN(
IF(B2:D="",,A2:A&"♥"&B1:D1&"×"&B2:D)), "×"), 2, 0)))
I think what you are looking for can be done by using a Index-Match function.
e.g. If you paste the following formula in an empty cell somewhere in the sheet,
=INDEX($A$1:$D$8, MATCH("Task 1",$A$1:$A$8,0),MATCH("Tech 2",$A$1:$D$1,0))
it gives you 20 corresponding to Task 1 and Tech 2.
If you paste the following in an empty cell somewhere in sheet,
=INDEX($A$1:$D$8, MATCH("Task 7",$A$1:$A$8,0),MATCH("Tech 3",$A$1:$D$1,0))
it gives you 36 corresponding to Task 7 and Tech 3.

How to seach column for all text matches in column A and sum all of the corrosponding values in column B Excel

I'm sure this is possible, but I've been trying various ways for the past 2 hours and can't find the solution.
I need to find all the instances of a text name in column A, lookup all the numerical results in column B and sum them together.
I thought =ArrayFormula(sum(lookup(F2,$A$2:$B$1000))) would do the trick, but it's only picking up the last value on the last mention and not all the values of all the mentions.
I've attached a spreadsheet to show the data I'm looking at.
Thanks to the reference from BigBen to check out Sumifs. Using this command, the following works a treat:
=SUMIFS(B2:B3115,A2:A3115,F2)
try:
=QUERY(A2:B; "select A,sum(B) where A is not null group by A label sum(B)''")

Resources