
Announcements
Need help here.
I am trying to get specific cell values from excel sheet and extract those values in list:
Required results:
| Lab | Sum |
| CN | 2234 |
| BN | 3245 |
| IN | 8765 |
Below is the data
| LAB | index | CW1 | CW2 | CW3 | CW4 | CW5 | CW6 | CW7 | CW8 |
| CN | 1 | 111 | 222 | 150 | 320 | 119 | 655 | 957 | |
| CN | 2 | 119 | 655 | 957 | 111 | 222 | 150 | 320 | |
| CN | 3 | 436 | 656 | 875 | 889 | 119 | 655 | 957 | |
| Sum | 666 | 1533 | 1982 | 1320 | 460 | 1460 | 2234 | ||
| BN | 1 | 111 | 222 | 150 | 320 | 119 | 655 | 957 | |
| BN | 2 | 119 | 655 | 957 | 111 | 222 | 150 | 320 | |
| BN | 3 | 436 | 656 | 875 | 889 | 119 | 655 | 957 | |
| Sum | 666 | 1533 | 1982 | 1320 | 460 | 1460 | 3245 | ||
| IN | 1 | 111 | 222 | 150 | 320 | 119 | 655 | 957 | |
| IN | 2 | 119 | 655 | 957 | 111 | 222 | 150 | 320 | |
| IN | 3 | 436 | 656 | 875 | 889 | 119 | 655 | 957 | |
| Sum | 666 | 1533 | 1982 | 1320 | 460 | 1460 | 8765 |
Hi @Shivaandure ,
I've made a test for your reference:
function main(workbook: ExcelScript.Workbook): MyData {
let selectedSheet = workbook.getWorksheet("Sheet1");
return {
CN: selectedSheet.getRange("I5").getValue(),
BN: selectedSheet.getRange("I9").getValue(),
IN: selectedSheet.getRange("I13").getValue(),
} as MyData;
}
interface MyData {
CN: string;
BN: string;
IN: string;
}
Result:
Best Regards,
Bof