Vlookup or better alternative for retrieving column D into Column N if C contains - regex

CONTEXT
Sheet 1, Column L has a combination of numbers and letters (internal reference) - e.g. 32948/78TPL
Sheet 2, Column C CONTAINS Column L (sheet1) - e.g. Payment proof for 32948/78TPL sent by Tom.
Sheet 2, Column D contains time/date
WHAT I WOULD LIKE TO ACHIEVE
Retrive on Sheet 1 Column N, the value of Column D where Column C (both from Sheet2) contains the value of Column L (sheet1)
Basically retrieve the time/date column from Sheet 2 for the correct row on Sheet1
WHAT I'VE TRIED
VLOOKUP("*"&$L7&"*",(Sheet12!C2:F),{3},false),"")
WHAT HAPPENS
It does return the correct value but works only for that row
If I change to VLOOKUP("*"&$L7:$L&"*",(Sheet12!C2:F),{3},false),"") it returns some strange values like "43984.76019" where the time/date cell should return values like "6/2/2020 18:14:40". So the range can't be assigned like that and probably the problem is trying to use a range with wildcards which I think it's not possible
If I manually stretch the formula (1st version) it returns wrong values for rows where Column L is empty
Is VLOOKUP the way to go?
Can someone please point me to a better direction?
Thanks in advance.

try:
=ARRAYFORMULA(IFNA(VLOOKUP(L2:L, {REGEXEXTRACT(Sheet2!C2:C,
TEXTJOIN("|", 1, L2:L)), Sheet2!D2:D}, 2, 0)))

Related

Input text in one column (a) if the value in another column (b) is found in another column (c)

I have two lists of people - they will not be sorted in the same order. The second list is in a different sheet. If the person listed in column A shows up in Column A in the second sheet, I want column F to display "Y." If not, I want column F to display "N."
This formula: =ArrayFormula(vlookup(A2:A,Attendees!A2:A,1,0)) almost gets me there, but I can't figure out how to get it to return Y/N instead of the name of the Attendee or not.
Any ideas?
try:
=ARRAYFORMULA(IF(IFNA(VLOOKUP(A2:A, Attendees!A2:A, 1, 0))="", "No", "Yes"))

Highlight row with highest cell value within dynamic range

I want to highlight the cells in a Google Spreadsheet with the highest values based on a dynamic range.
I've got two columns: column K and column L. Column K contains sums of data, column L contains either 'Yes', 'No' or 'Maybe'.
I want to use conditional formatting to highlight the rows with the highest value in column K AND which contain 'Yes' in column L (so, the highest value in column K is only calculated from the rows that contain 'yes' in column L as well). It is possible that there's multiple highest values that have 'Yes'. So while the absolute highest value in the whole of column K can be found on (for example) K100, and the second-highest is found on K59, if L100 doesn't include 'Yes' on column L but L59 does, row 59 will be highlighted.
I've got this code for highlighting whenever L is equal to 'Yes':
=$L:$L = "Yes"
And this code for highlighting the highest value in column K:
=$K5=MAX($K$5:$K$999)
But I have to combine them somehow.
I think that some kind of IF- or AND-statement will be the solution, but I don't know how to dynamically call on the range I need. The position of the Yes'es change based on other values and are not necessarily below each other. For instance:
=IF($L:$L="Yes";MAX($K1;$K3;$K4;$K9))
Where '$K1;$K3;$K4;$K9' represents the dynamic range.
try like this for range A5:Z:
=($L5="Yes")*($K5=MAX($K$5:$K))

How to change index number of a column to specific words in PowerBI

I have a column in a table with 0s and 1s.
I would like to change 0 to 'Not Paying' and 1 for 'Paying' to make it more intuitive for my visuals.
What is the best way to do this?
Should I create a new table, create a new column, or any other idea ?
It depends if you want a new column o transform it.
Go to Edit Queries. Then you can right click on the column and look for "Replace Values".
With that option you can replace some text to another one.
If the option is not available, first you have to change the type of the column to "text".
Regards,
Just create a calculated column using the following DAX:
New Column :=
SWITCH (
TRUE (),
'Table'[Old Column] = 0, "Not Paying",
'Table'[Old Column] = 1, "Paying"
)

M query - Edit the value of cell H2 in a table

Having imported an excel sheet into power query, I need to tidy it up by changing the value of a particular cell.
At the moment that cell has a null value, but there are other null values in the same column that I do not want to change. – So I cannot replace all of the null values in that column with another value.
I also cannot correct that particular cell in the source excel file (there are hundreds of them, which were created before I arrived).
I basically need some syntax for example that sets the value of cell H2 to “Jeep”, but not to change any other cells.
Very grateful for any insight.
One way would be:
In the Power Query Editor:
Add an index column starting from 1 (tab Add Column)
Add a Conditional column: If [Index] = 2 then Jeep else [H] (tab Add Column)
Delete Index column and [H] Column
Rename Custom column to [H].

Sum values in one column of all rows which match one or more of multiple criteria

I have some table data in which I'd like to sum all the values in a specific column of all rows where column A contains string A and/or column B contains string B. How can I achieve this?
This works for one criterium:
=SUM(FILTER(G:G,REGEXMATCH(F:F,"stringA")))
I tried this, but it didn't work:
=SUM(FILTER(G:G,OR(ISTEXT(REGEXMATCH(F:F,"stringA")),ISTEXT(REGEXMATCH(C:C,"stringB")))))
Please try:
=SUM(FILTER(G:G,REGEXMATCH(F:F,"stringA")+REGEXMATCH(C:C,"stringB")))
+ works for or logic. ISTEXT is not needed because REGEXMATCH gives true or false.
OR does not work because filter is an arrayformula, use + in array formulas.
=SUM(FILTER(G:G,REGEXMATCH(F:F&C:C,"stringA|stringB")))
OR is denoted by |
EDIT Added &C:C to denote different Columns