Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
Read value from specific cell in specific worksheet

I'm reading in a number of report files to create one dataframe which is working okay

cwd = os.path.abspath('') 
files = os.listdir(cwd)  
col_list = 'column1','column2'

df = pd.DataFrame()
for file in files:
    if file.endswith('.xlsx'):
        d = pd.read_excel(file,'worksheet1', usecols = col_list)
        df = df.append(d, ignore_index=True) 

The date that each file was created is stored in the same file but in a different sheet in cell B3. I'd like to add this value as a new column to each record for that file.

I've tried using .cell(row,column) as so:-

df = pd.DataFrame()
for file in files:
    if file.endswith('.xlsx'):
        d = pd.read_excel(file,'worksheet1', usecols = col_list)
        d['value'] = 'worksheet2'.cell(3,2)
        df = df.append(d, ignore_index=True)

but get the error AttributeError: 'str' object has no attribute 'cell'

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!