Read particular cell as column name not as index

Hi Team,

i have an excel file, i should select column as “Debit(AUD)” or some time it will be only “Debit” and i should go for the last total and read that particular cell.

In this, i should select column name as “Debit(AUD)” and go for the last in that column and read that particular cell(contains 25,405,177.14).

what i have did is

first i taken read range and get the datatable as output
next, i taken read cell, in that cell name if i take as index its working fine, but i need column name(dt.rows.count) will get the count.
in the cell, i tried like this as “Debit(AUD”)+(dt.rows.count).ToString
but am facing error.
can any one help me on this

1 Like

Hi @Sharanabasava,

If the column name or index is constant what I mean to say is if Debit column is always constant suppose index 1 in your case.

You can get how many rows are there by datatable.rows.count-1
Just make sure the above condition is representing the last row that is total

Now you know in which row you have value and from which column or index you have to extract

Datatable.rows(datatable.rows.count-1).item(index of your column).tostring

1 Like

Hi Anil,

Thanks.

Here the column will not be always Debit(AUD)

Sometimes it will be only Debit and as index wise… It will not be 1st…it may be 5th position.

1 Like

If the 5th position is always constant use the above expression and try once

1 Like

Hi,

It will not be always 5th position… So have to select through column header

1 Like

use filter data table it using header name.

but your read range activity → if your headers is in row1 then put “A1” → checklist the AddHeader in the property panel.

Hi,

here i am doing through index, but i need as column name and column name also varies and index will not be fixed.

Hi @Sharanabasava,

If possible can you provide the excel file with few rows, so that i can help you with exact solution.

1 Like

Hi @Sharanabasava

I have take a sample excel file with random column as Debit(AUD) you can change this to Debit also
EXAMPLE.xlsx (50.0 KB)

Please refer the sample workflow which extracts in which index the debit column is

Main (25).xaml (8.0 KB)

1 Like

Hi,

Please find sample files…in one file it contains as Debit(AUD) and in another file as Debit

Hi @Sharanabasava,

Main (25).xaml (11.3 KB)

Refer the above workflow, the above workflow works for both the excel files provided.

Just change the path of the file to your location where the file is, and look for output section.

1 Like

Hi Anil,

Thanks, its working for debit column and i need for credit column also
i am attaching my .xaml file, and i made changes for credit also

but its not workingTesting1.xaml (23.2 KB)

1 Like

Hi @Sharanabasava,

Community forum is for learning not for getting the solutions in your project, i have provided an example for debit column and similarly you have to make changes for the credit column.

As you have got the solution for your question close the topic and try for similarly for credit column, it will be same as debit column and still if you doesn’t get the solution i will help you for sure.

2 Likes

Hi anil,

Ok thanks

1 Like

Hi @Sharanabasava,

Can you mark it as solution the above post and close the topic.

1 Like

Testing1.xaml (25.9 KB)

i tried with change, but in the last for credit…i am getting negative value…Pls can you check

1 Like

Hi @Sharanabasava
Refer the below workflow

Testing1.xaml (16.6 KB)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.