Jul-20-2020, 07:54 PM
(This post was last modified: Jul-20-2020, 07:54 PM by Kristenl2784.)
Hello,
Is there a way to search for a string, and once it's found return the value thats 9 cells below it?
This code reads in TFile only column B data. Then it reads in TDetail looks at cell A1 shortens the word, and then makes it a string example AA1150. Then I want to search for TDetail (example AA1150) inside TFile, and once that string is located return the value that is 9 cells below it.
TFile = Row B tons of data TDetail= string example AA1150
Search TTFile for TTDetail once found return value 9 cells below it.
Is there a way to search for a string, and once it's found return the value thats 9 cells below it?
This code reads in TFile only column B data. Then it reads in TDetail looks at cell A1 shortens the word, and then makes it a string example AA1150. Then I want to search for TDetail (example AA1150) inside TFile, and once that string is located return the value that is 9 cells below it.
TFile = Row B tons of data TDetail= string example AA1150
Search TTFile for TTDetail once found return value 9 cells below it.
TFile=pd.read_excel(TF, usecols="B") TDetail=pd.read_excel(input_file, usecols="A",nrows=1,header=None,squeeze=True).str.slice(start=28,stop=-2).to_string(index=False).strip() result=TFile['Name'].str.contains(TDetail)