Transactie analyse (excel)
Tue Dec 03 2024 20:08:34 GMT+0000 (Coordinated Universal Time)
Saved by
@digitalwillem
#python
import openpyxl as xl
from openpyxl.chart import BarChart, Reference
from openpyxl.utils import column_index_from_string
def transactie_analyse (filename):
wb = xl.load_workbook('filename')
sheet = wb ['Blad']
for row in range(2, sheet.max_row + 1):
cell = sheet.cell(row,3)
corrected_price = cell.value * 0.9
corrected_price_cell = sheet.cell(row, 4)
corrected_price_cell.value = corrected_price
values = Reference(sheet,
min_row=2,
max_row=sheet.max_row,
min_col=4,
max_col=4)
chart = BarChart()
chart.add_data(values)
sheet.add_chart(chart,'cel')
wb.save(filename)
content_copyCOPY
Excel cursus 1 test analyse orders
Self
Comments