The first problem I see with this code is that the Excel range is not clearly specified. A range specification is for a named range in the Excel workbook. If you truly need to pick up data from a cell range, make that area a named range in Excel before trying to access the data in SAS. For example, if your named range was called "Stats", this code would work:
proc import datafile="data.xlsx"
out=forecast&sysdate. dbms=excel replace;
range="Stats";
getnames=yes;
run;
data in_capacity&sysdate.;
set forecast&sysdate.;
Capacity=Filled_Appointments/Total_Appointments_Avalable;
run;
proc sort data=in_capacity&sysdate.;
by Capacity;
run;
But you could skip all of the PROC IMPORT, DATA step and PROC SORT stuff, too. Using an XLSX LIBNAME statement would make this much simpler:
libname myxl XLSX "data.xlsx";
proc sql;
create table in_capacity&sysdate. as
select *
,Filled_Appointments/Total_Appointments_Avalable as Capacity
from myxl.Stats
order by Capacity
;
quit;
This assumes a new Excel sheet is created each day containing only that day's data, and that the range is always named the same.