Qt c++ xlsx get maxımum row for calculate average
-
I'm trying calculate average of some datas. Qxlsx bibrary says use
xlsx.write("B9", "=AVERAGE(B3:B5)", lAlign);
for calculate average but by end cell not known.
When I made chart I tried sth kile this and its worked.lineChart -> addSeries(CellRange("C7:C" + maxRow), xlsx.sheet("Sheet1"));
max Row is my maximum row number. How can I append my end row to average function? here is library.
Qxlsx examples folder -
I'm trying calculate average of some datas. Qxlsx bibrary says use
xlsx.write("B9", "=AVERAGE(B3:B5)", lAlign);
for calculate average but by end cell not known.
When I made chart I tried sth kile this and its worked.lineChart -> addSeries(CellRange("C7:C" + maxRow), xlsx.sheet("Sheet1"));
max Row is my maximum row number. How can I append my end row to average function? here is library.
Qxlsx examples folder@mangekoyu
If you can't figure what your max row count is, your could just put9999
in and that might do you :) -
@mangekoyu said in Qt c++ xlsx get maxımum row for calculate average:
xlsx.write("B9", "=AVERAGE(B3:B5)", lAlign);
Did you try something like:
xlsx.write("B9", QString("=AVERAGE(B3:B%1)").arg(maxRow), lAlign);
-
@mangekoyu said in Qt c++ xlsx get maxımum row for calculate average:
xlsx.write("B9", "=AVERAGE(B3:B5)", lAlign);
Did you try something like:
xlsx.write("B9", QString("=AVERAGE(B3:B%1)").arg(maxRow), lAlign);
-
@mchinand
I think the OP's question is that he does not know the value to put inmaxRow
, not that he doesn't know how to output it. Hence my previous answer.@JonB can't you find the last row via 'Worksheet::dimension()'?
-
@JonB can't you find the last row via 'Worksheet::dimension()'?
@DerReisende
I have no idea, I don't use or need QtXlsx. The OP might! Or he can plonk 9999 in there. -
@JonB said in Qt c++ xlsx get maxımum row for calculate average:
If you can't figure what your max row count is, your could just put 9999 in and that might do you :)
@JonB I tried '
QString averval = "=AVERAGE(B7:B" + maxRow + ")";
I can get this one when I debug it.
"=AVERAGE(B7:B413)"
-
@JonB said in Qt c++ xlsx get maxımum row for calculate average:
If you can't figure what your max row count is, your could just put 9999 in and that might do you :)
@JonB I tried '
QString averval = "=AVERAGE(B7:B" + maxRow + ")";
I can get this one when I debug it.
"=AVERAGE(B7:B413)"
@mangekoyu
So if you do knowmaxRow
, or use9999
, either way what is your problem?