ConvertExcelHeaderRowsInColumn <- function(DT, col, nm.newCol="EXCEL_HEADER_ROWS", markerCols=setdiff(names(DT), col)) {

  ## Error Checks
  {
    if (nm.newCol %chin% names(DT))
      stop ("'", nm.newCol, "' is already a column in the DT")
    if (any(markerCols %ni% names(DT)))
      stop ("some columns of markerCols are not in the DT: ", pasteQ(setdiff(markerCols, names(DT))))
    if (length(col) > 1)
      stop ("'col' should be of length exactly one.")
    if (col %ni% names(DT))
      stop ("the value of 'col' ('", col, "') is not in the DT.")
  }

  ## Deep copy
  DT <- copy(DT)

  DT[, .markerCols.are.NA := rowSums(is.na(.SD))==length(markerCols), .SDcols=markerCols]

  browser(expr=inDebugMode("ConvertExcelHeaderRowsInColumn"), text="in ConvertExcelHeaderRowsInColumn after copying and marker rows")

  ## Error Checks
  ## There should not be any runner-runner NA markers; they would be indicated by diff==1
  if (!all(DT[, diff(which(.markerCols.are.NA)) > 1]))
    stop("There should not be consecutive marker rows.\nHINT: check around (+/- 1) rows ", commaSep(DT[, {wh <- which(.markerCols.are.NA); wh[c(diff(wh) <= 1, FALSE)]}]), "\n")
  ## The first row should be an indicator -- although maybe not in all circumstances
  if (!DT[1, .markerCols.are.NA])
    stop ("markers for the first row is FALSE. -- should this be an error? If not, how should they be handled")
  if (!DT[, sum(.markerCols.are.NA)>1])
    stop ("There is not more than one marker rows (possibly zero) -- should this be an error?")

  DT[, (nm.newCol) := get(col)[.markerCols.are.NA], by=list(cumsum(.markerCols.are.NA))]


  return(DT[!(.markerCols.are.NA)][, .markerCols.are.NA := NULL])
}
