# Write spreadsheet file with indexed set

**URL:** <https://discuss.ampl.com/t/write-spreadsheet-file-with-indexed-set/376>\
**Category:** Support\
**Created:** [February 14, 2023, 4:21pm UTC](https://discuss.ampl.com/t/write-spreadsheet-file-with-indexed-set/376 "2023-02-14T16:21:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivi](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/vivi/32/156_2.png) [@Vivi](https://discuss.ampl.com/u/Vivi)\
**Post date:** [February 14, 2023, 4:21pm UTC](https://discuss.ampl.com/t/write-spreadsheet-file-with-indexed-set/376/1 "2023-02-14T16:21:13Z")

</div>

Hello,

I would like to write the parameters ( Cd, Fs, Ef ) and also the sets (set F1T, set F1H) that I have given the sample data below in a spreadsheet file to make then read by Ampl. I am not sure I’am writing then in the correct way.  
I am writing the aks for your help.

# Sets

set ND  
set F1 {ND} ;  
set F1T {d in ND} within F1[d] ;  
set F1H {d in ND} within F1[d] ;  
set F1E {d in ND} within F1[d] ;

# Parameters

param Cd {d in ND, t in (F1T[d] union F1H[d])} \>=0 ;  
param Fs {d in ND, t in (F1T[d] union F1H[d])} \>=0 ;  
param Ef {d in ND, t in (F1T[d] union F1H[d])} \>=0 ;

# Data

set ND := DC1  
set F1[DC1]:= TT1 TT2 TH1 TH2 TE1 TE2 ;  
set F1T [DC1]:= TT1 TT2 ;  
set F1H [DC1]:= TH1 TH2 ;  
set F1E [DC1]:= TE1 TE2 ;

param Cd: TT1 TT2 TH1 TH2 :=  
DC1 10 20 10 30 ;

param Fs: TT1 TT2 TH1 TH2 :=  
DC1 40 10 20 30 ;

param Ef: TT1 TT2 TH1 TH2 :=  
DC1 20 30 10 40 ;

Best regards.
