function getColumnIndexInVisibleAndGroupedColumns(oTable, oColumn) {
		const aVisibleAndGroupedColumns = oTable.getColumns().filter(function(oColumn) {
			return oColumn.getVisible() || (oColumn.getGrouped ? oColumn.getGrouped() : false);
		});

		for (let i = 0; i < aVisibleAndGroupedColumns.length; i++) {
			const oVisibleOrGroupedColumn = aVisibleAndGroupedColumns[i];

			if (oVisibleOrGroupedColumn === oColumn) {
				return i;
			}
		}

		return -1;
	}
Returns the index of the column in the array of visible and grouped columns

@param {sap.ui.table.Table} oTable Instance of the table.
@param {sap.ui.table.Column} oColumn Instance of the table column to get the index for.
@returns {int} Returns the index of the column in the list of visible and grouped columns.
               Returns -1 if the column is not in this list.