write a formula for excel
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
hi I want to write a long formula in excel like this: if(A1=$C1,1,if(A1=0,0,-.33))+if(A2=$C2,1,if(A2=0,0,-.33))+ ... for 1 to 100 to avoid copy and paste 100times I write a code in matlab but it error I wrote:
for i=1:100 display('if(Ai=$Ci,1,if(Ai=0,0,-.33))+') end how to change my code to write formula correctly?
0 Commenti
Risposta accettata
Geoff Hayes
il 4 Set 2014
for k=1:100
fprintf('if(A%d=$C%d,1,if(A%d=0,0,-.33))+',k,k,k);
end
The above will write a single line to the Command Window with all the if statements. If you want each statement on a separate line, just add \n to the end of the string
fprintf('if(A%d=$C%d,1,if(A%d=0,0,-.33))+\n',k,k,k);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!