Formulas Column Names

Tags: #<Tag:0x00007efc605c0d38>

I am using HT to display invoices. The user has the ability to create ,formulas to check data integrity. My issue is that the columns have descriptive names and I found that we can not use those names in our formulas!
=SUM(Cost2:Cost3)
I have some hidden columns intermingled in the data that can show or not show depending on the stage of the invoice. Is this something that is in the works, is there a setting I missed? Should I program around it?
And where is the equation stored sop that I can save it

Hi @jwahl

you may find the range useful. Here’s an example http://jsfiddle.net/handsoncode/3mtu3d49/
The formulas are available via getSourceData() method, demo http://jsfiddle.net/handsoncode/5Lspgpeh/

Awesome, getting the original function is great.
So, but I dont think I explained myself properly. When I type the formula in I have to use A,B,C,D… column names. But my column names are dynamic So it could be Cost, Amount or something like that.
To write a formula I need to use D3+D4 where D is the Column Cost. I need to let the user write Cost not D.

Does that make sense?

Yes, of course it does make sense. However, we do not support key values as a part of a formula syntax yet.

When your ready line 26964 for handsontable.full.js

function columnLabelToIndex(label) {
var result = 0;
if (typeof label === ‘string’) {
label = label.toUpperCase();
var colhdrs = hot.getColHeader();
for(var i =0;i<colhdrs.length;i++){
if(colhdrs[i].toUpperCase() == label){
result = i;
}
}
}
return result;