I have a function that searches a spreadsheet for a name I put in cell A1 and returns a column in that row
eg, if I enter Smith in A1 it will return all columns C´s where Column D contains Smith, I would also like it to return columns containing smith so if a cell as john smith it would also be returned,
this is what I have so far but it only returns Total match,
=FILTER(Results!C:C,Results!$D:$D=$A$1)
Hope someone can help,
Thanks in advance
I believe this is what you're trying to do:
=filter(Results!C:C,find(lower($A$1),lower(Results!D:D))>=0)
EDIT: adding the lower() function to make the comparison case insensitive.
Related
Purpose: I'm trying to fetch the value from column c in the first sheet, where column a matches to column a in current sheet. If there are more than one matches in column a, fetch the most recent entry, according to the date in column b. If the most recent cell in column c was left blank, go back and fetch from the most recent matching row in which column c contains a value.
See the sample sheet, it's pretty clear.
I tried: =INDEX(FILTER(SORT('VISIT LOG'!C2:C,'VISIT LOG'!B2:B,FALSE),'VISIT LOG'!A2:A=A2,'VISIT LOG'!C2:C<>""),1,1)
But it's not working.
Any help will be appreciated!
you can try:
=INDEX(IF(LEN(A2:A),IFNA(VLOOKUP(A2:A,SORT(LAMBDA(z,FILTER(z,INDEX(z,,3)<>""))('Visit log'!A2:C),2,0),3,)),))
You can try with QUERY and MAP:
=MAP(A2:A,C2:C,LAMBDA(ax,cx,IF(ax="","",QUERY('Visit log'!A2:C,"Select C where C is not null AND A = '"&ax&"' order by B desc limit 1"))))
would like to return value of 'Earnings per share' (i.e. -7.3009, -7.1454, -19.6295, -1.6316)
from "http://www.aastocks.com/en/stocks/analysis/company-fundamental/earnings-summary?symbol=01801"
using below as a example for '-7.3009'
=importxml("http://www.aastocks.com/en/stocks/analysis/company-fundamental/earnings-summary?symbol=01801", "//tr/td[contains(text(),'Earnings')]/td[2]")
However, it returns #N/A.
Can someone help?
this xpath will return your specific data
id("cnhk-list")//tr[td[contains(., "Earnings Per Share")]]/td[starts-with(#class, "cfvalue")]//text()
xpath explanation in english is " you actually needs to select the td where row contains Earnings Per Share which is in table that has some specific ID
I have a google sheet with a column of item names, (i.e. "Amy dress, Brooke Tshirt, etc.) Some of these items have a prefix - JK or JL (JK - Amy Dress, JL - Brooke Dress) in addition to the non-prefixed versions. I'm trying to find a way to search for a prefix (JK - ) and return the item name associated with that prefix in a different column.
Search for "JK - ", find JK - Amy Dress, return Amy Dress. Please help!
Tried lookup and match, but this is too complicated for my skill set.
You can try to use a Google Sheets Query.
If you want something like this:
Based on the table above the query you'll have to use will be:
=query(A:B;"select * where B Starts with 'JK'";-1)
If you want to select only the B column just remove the A:
=query(B;"select * where B Starts with 'JK'";-1)
The query automatically creates a new "table" with all the values you need.
If you want to make it customizable use the following query:
=query(A:B;"select * where B Starts with '"&$G1&"'";-1)
In this case instead of "JK" we are searching something that starts with the content of the cell G1. So if you type JK in the G1 cell you will obtain the same result as before.
Hope it helps.
I'm having trouble using XPath to find a row in a table where a specific column contains a value. The table has 10 columns where 2 of them will show Yes|No but I'm only interested in finding the value in one of the columns (the 4th one). My initial attempt was this:
//table[#id='myTable']/tbody/tr/td[text() = 'Yes']
but it finds it rows from both columns. I thought I could try something like this but it's not a valid expression:
//table[#id='myTable']/tbody/tr/td[4]/text()='Yes'
Any suggestions? Thanks.
You can try this way :
//table[#id='myTable']/tbody/tr[td[4][. = 'Yes']]
The XPath return row (tr) having the forth td child value equals "Yes".
I can't work out if this is possible or not, I've got a basic table but that table has a varying number of rows and data within it.
Assuming the table is just one column wide and a random number of rows long to select a row containing the text "COW" I can do something very simple like do: -
table/tbody/tr[contains(td[1],"COW")]/td[1]
But lets say that this table contains two types of data in it, a list of animals and, underneath each animal, a list of attributes, all in the same column, looking something like this: -
COW
Horns = 2
Hooves = 4
Tail = 1
CHICKEN
Horns = 0
Hooves = 0
Tail = 1
Is there a way using XPATH to first identify the row that contains the text COW and then select the row directly after this to return the text "Horns = 2"?
Cheers
It seems that you want something like this:
table/tbody/tr[contains(td[1],"COW")]/following-sibling::tr[1]/td[1]
This will select the first td in the row immediately following the row which contains the td which contains COW.