Thanks:  0
Likes:  0
Dislikes:  0

# Thread: How can I calculate Sum of the total in the Excel

1. ## How can I calculate Sum of the total in the Excel

I have the webtable. In my table I have the Column headers like this Student No, FName, LName, Score

Student No. FName LName Score
001 aaa bbb 123
234
568

How can I calculate the Sum of the Score (I mean 123+234+568=925)

Thanks
sai

2. ## Re: How can I calculate Sum of the total in the Excel

In Excel you would use the SUM function but I suspect that you are looking for how this would be done in QTP -

3. ## Re: How can I calculate Sum of the total in the Excel

Hi Lynne

I know SUM Function in Excel. But i am looking in qtp

4. ## Re: How can I calculate Sum of the total in the Excel

You can use Excel functions in Data sheet also.

5. ## Re: How can I calculate Sum of the total in the Excel

Hi Tarun,

Could You please tell me How can i use the Excel function in the Data Sheet.

Thanks
Sai

6. ## Re: How can I calculate Sum of the total in the Excel

DataTable("Test2")="=SUM(A1:A4)"

Msgbox DataTable("Test2")

7. ## Re: How can I calculate Sum of the total in the Excel

Hi Tarun,

When i use this code it's not working

DataTable("A",dtlocalsheet)='=SUM(A1:A3)"
res=DataTable("A",dtlocalsheet)
Msgbox res

Result: Msgbox display 1000

MyExcelSheet Like this
SheetName is Action1
Column name is A
Rows is
1
2
3

When i add Row2+Row3 it's working correct
But when i add Row1+Row2+Row3 it's not working

Thanks
sai

8. ## Re: How can I calculate Sum of the total in the Excel

Hi,

The excel sheet of a QTP script is saved at the some hard drive.

So the functions you want to use on the Excel sheet can be done at this place. This Excel at hard drive will follow up in QTP script.

Thanks,
Amol

9. ## Re: How can I calculate Sum of the total in the Excel

You can use the formula on the same column that you are trying to output

Now doing DataTable("A",dtlocalsheet)="=SUM(A1:A3)" you are refering to A1 to A3 and assigning the value to A1 so which would be circular reference.

10. ## Re: How can I calculate Sum of the total in the Excel

Thanks Tarun,
And i have one more question how can i get the particular cell value from DataTable.

Example: In datatable 4 Column and 4 Rows
I want 3 Column 2 Row (i mean cell(3,2)) value

How can i get it.

Thanks

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.