Hello,
I'm trying to create a sparkline that references a single column of about 50 rows. Ideally, I'd like the x-axis to scale based on new data that are entered vertically.
The data are going to be in B3:B52 (50 cells in all). Right now, there are only 20 datapoints entered as an example (B3:B26) and there are some blanks within that range, intentionally.
-
I've used the below formula in the name manager and set the sparkline's source to that named range, but it still produces a sparkline that is sourcing all the empty cells (B3:B52 instead of B3:B26) that don't have data in them just yet.
=OFFSET($S$2,1,0,COUNTIF($S$3:$S$52,"<>"""))
-
Then, I tried the below formula, expecting that it would increase in height as more data were added. Instead, the offset range is still static (D3:D52 instead of D3:D26) and there's no sparkline shown in the target cell.
=IF(OFFSET($D$2,1,0,COUNTIF($D$3:$D$52,"<>0"))=0,"",OFFSET($D$2,1,0,COUNTIF($D$3:$D$52,"<>0")))
-
Maybe the sparkline isn't showing because the named range is producing an error?
The example workbook is attached. The first dataset is the more complex formula and the second dataset is the one that kind of works but doesn't scale the x-axis.
Bookmarks