Domanda

I am working with the following table in Excel:

Excel image

The following formula in evaluates normally when entered directly into a cell:

=DATE(YEAR(DATEVALUE($A$1)),MONTH(DATEVALUE($A$1)),DAY(INDIRECT(ADDRESS(2,COLUMN()))))

However, when I try to place put this in the named function test and call =test in another cell it returns a #VALUE! error. The best answer I have come up with after researching is that named formulas and the indirect function are not always compatible.

If anyone can shed some light to help explain what I am doing wrong or why I can not put an indirect call inside of a named range I would greatly appreciate it!

È stato utile?

Soluzione

Yes, I don't believe INDIRECT will work with a named range - you shouldn't really need such a convoluted formula - try just

=(C$2&$A$1)+0

format as date

Edit: as per comments below, INDIRECT is OK but I don't think COLUMN() is liked in the named range. ROW and COLUMN functions sometimes behave badly because they return "arrays" even when single values, so you need another function like MAX or SUM to convert {2} to 2, e.g.

=DATE(YEAR(DATEVALUE($A$1)),MONTH(DATEVALUE($A$1)),DAY(INDIRECT(ADDRESS(2,MAX(COLUMN())))))

although I think there are shorter methods as I indicated above....

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top