Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Table Range in Excel Online "Create Table" node



Every day, we save an Excel file on our Sharepoint environment and create an Excel Table in the file. 

The content of the Excel file is different every day. Different number of rows as well.


When I use the "Create Table" node from the Excel Online package, I need to specify the Table Range.

Every file contains columns A to column DN. But the rows are different. 

It tried the table Range "A:DN" but when I do that, it creates a lot of empty rows at the end of the data table. So I think I have to specify the number of rows as well.


For example today I have 412 rows. So the table range is "A$1:DN$412". 


My question is: Do I really need to specify the number of rows in the table range? and if so: How can I extract the number of rows from an Excel file?





Community Support
Community Support

Hi @Anonymous ,


You need to specify the number of rows in the table range and however, there is no any way to extract the number of rows from an Excel file currently.


Best regards,



Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Memorable Member
Memorable Member

Hi @Anonymous 


Yes, you need to set the range.


You can measure the rows with a expression inside a compose:

The expression is 




You need to change the red text to your action name, like the print below:


Best Regards

Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!

Not applicable



In your example you first use the node 'List rows present in a table' and then use a compose node to extract the number of rows. 

But in the node 'List rows present in table' you have to select the table inside the Excel file. But I don't have a table, because I first need the number of rows to create it.



Hi @Anonymous 


Sorry for my wrongly understood.


I think this article can help you:


Count on me for what you need

Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!

Not applicable

Hi @Anonymous  do you have already your issue with dynamic table range ?

MS FLOW Excel Online 'Create a table' dynamic table range


Hey Guys,

This one has been bugging me. I'm a python programmer, trying to help someone move and parse files in MS Teams, so some of things I see in MS FLOW are just weird, and really get away from the whole point of giving business users the ability to create a FLOW with minimal to zero "coding". I'm sure there are some that have the ability, inclination and TIME to create FLOWS, but from what I've seen and the business people I have talked to that are really good working in excel formulas, they find getting FLOWS to work fairly difficult. Needless to say, once again, MS is about Marketing and not about making it easy and making users happy.


FLOW I was asked to help create;

Take an email with some .xlsx attachments.

Go thru each attachment;

    Pull out the rows from each.

    Append each row to the proper main spreadsheet ( there are three of them, and which one you append the rows to, depends on which client they are associated with).


1. Starting the email trigger was easy, no sweat.

2. Saving the attachment spreadsheets was ok, but I did learn that you mostly need to set up a "Do until" action, to wait for the spreadsheet to be created or really, saved inside Sharepoint, before I can pull the rows from it. It can take any where from 20 seconds to 1 minute for it to be saved.

3. Now here is where it gets tricky. I just want to go into the spreadsheet I just saved from the "Create file" Action and get the rows from "Sheet1", starting in cell "A1". There used to be a "Get rows" feature that, from what I read, was pretty easy to use, but they took that away.  Now, In order to get rows from a spreadsheet, you need to have the data thats in the spreadsheet exist inside of a "Table".  But, the .xlsx files I get as attachments are from a 3rd party and the data is not inside of a "Table", and I think this is the same for alot of people. So after you save your spreadsheet to Sharepoint (or One-Drive), which you are forced to do, you need to wrap the existing rows of data inside of a "Table", using the Excel Action "Create Table". Ok Fine. But hold on - and this is what MS Technicians are telling you - you need to explicitly state or in reality HARD-CODE what the exact range is in this Action in order to create the "Table".  But for me, the row range will be different for each spreadhseet coming in. Thankfully, I do know the columns will always be the same - from A to N - however some of the cells/column values will be blank, always. So columns A,B,C I know will always have values, but columns G,H,I will always have blank values (don't ask). Ok so I how do I tell it create a dynamic range for the table no matter how many rows are in a spreadsheet?  I'm glad I asked!!

    1). One power user suggested just setting a row range with a very large value, something over and above what is to be expected. This works really well, you just need a conditional to look for non-blank rows.

    2). You can also use "Office Scripts" to create a Macro, but some folks might not have "AUTOMATE" permissions inside Excel online.

    3). But I kept thinking about the hover instructions inside the "Table range" field in the Action --> "Enter the table address in A1 notation". We know that in Excel there are several ways to create a range, using A1 notation. Why can't we use something like OFFSET combined with SUBTOTAL within this Action? It turns that you can! If someone else has discovered this, I did not find your post and I apologize in advance, I'm not here to rain on your parade, I just want people to know that this exists.  I really want to show this one to everybody, so more information, more better in my view. CAVEAT - But keep in mind - if you have columns that have cells (meaning all cells) that can be blank, YOU CANNOT USE SUBTOTAL within OFFSET to count the columns! It will get the dynamic number of columns wrong, and then push some of the data out of the "Table". Also you can't enter NEW column names in the Action "Column names" field, its only for existing colunm names field... SO if your spreadsheet does not already have a column header row, entering new Column Header Names inside the "Column names" field will overwrite your first row of data!! WHAAAT?!?!.  See below;


I tried to Add Column Header Values "A;B;C;D;E;F;G;H;I;J;K;L;M;N" as you can see in row 1 below, but this overwrote the first row of data, and on top of that, the SUBTOTAL(3,Sheet1!A1:N1) I tried to use within OFFSET to dynamically get the Column count, pushed the last 3 columns of data outside of the table.




In my case I know I will always have columns A thru N. So I created an OFFSET to create the range dynamically (mostly - meaning I know the number of columns, these wont change) and use SUBTOTAL within OFFSET to count the rows of data.


Here is how OFFSET/SUBTOTAL Works;



1. Sheet1!A1 - this is the reference point where we want to start

2. ,0,0 - this says from that reference point above, move down 0 rows and over 0 columns, effectively starting at A1.

3. SUBTOTAL(103,Sheet1!$A:$A) - this represents the number of rows we want in our range base on column A, the "103" tells SUBTOTAL we want a count of the active rows (rows with data) in column A, and informs OFFSET we want the number returned from SUBTOTAL(103,Sheet1!$A:$A) as the number of rows in our range.

4. 14 - these are the number of columns we want in our range - again use we tried to use something like SUBTOTAL(3,Sheet1!A1:N1) to get the column count, but if you don't have Column Headers AND have blank values in some of your columns then this will wreak havoc, and not calculate the Column Range properly.  Hopefully you know the column count like I do.


Thats it, here is a pic;




Hope this helps someone!,





So, again ;), my incoming spreadsheets DO NOT have Column Headers.  My first piece of advice is, for those that have the same situation - if at all possible, have the folks that are creating spreadsheets that you need to get rows from, to just add a Column Header for you.  It will make your life much easier. But for those that are not that fortunate, here are my travails in dealing with not having Column Headers...

When you are working in Excel either standalone or online (not in MS FLOW, but normally), you insert a "Table" in your spreadsheet, there is a checkbox that asks if you if "My table has headers". If you don't check ON this box (see below), it will magically insert headers for you...



Excel "Insert table" with checkbox asking if you have a header.



BEFORE - Raw data before "Insert table", with no header.



AFTER - Table-ized data where it inserts column headers automatically and moves rows down.

But the Excel MS FLOW Action to "Create table" does not incorporate this checkbox or other option to insert a header for you if you don't have one, and move the data rows down. It will either consider the first row of data as the header, or if you enter "Column names" in that field on "Create table" it will replace the current headers you have or overwrite the first data row.


I'm not sure what it would take to incorporate a checkbox that would INSERT a new header row if you don't have one, but this functionality is already in Excel, why is it not here in MS FLOW?

So, here are the hoops I had to jump through and the lessons I learned...

1. I added an action "List rows present in a table".
2. Within the output from "List rows present in a table", the rows are returned in an array with a (I guess) dictionary object contained inside curly braces ( { } ) very much like a json object, with key value pairs separated by a colon, with the key as the column header, and the value as the data values inside the cell. But in this case, the headers are acutally the first row of data, because again, as I've said 10 times already, I DONT HAVE COLUMN HEADERS IN MY SPREADSHEET. This is what it looks like, with the first to elements related to MS FLOW Excel internal tracking, and my elements starting in element 2 (zero based);


Rows array example, which each cell value is a KEY-VALUE pair like "24XTD08521-7004":"24XTD08515-7049" with the KEY(which is the header value, left of the colon ':') is the first row value, and the VALUE is the 2nd row value right of the colon ':'

[{"@odata.etag":"","ItemInternalId":"7a3ca2a2-c6a2-47b2-8cb0-ecdec9f4f856","QUARTZ1":"QUARTZ1","ALEESON VAHN/EDDIOT RANGER":"VAHN/EDDIOT RANGER MANCHEESE","2018-12-05":"2018-12-05","0040701":"0040702","24XTD08521-7004":"24XTD08515-7049","2":"1","Column1":"","QUARTZ COMPANY":"DELIA PACKAGING","80":"40","Column2":"","Column3":"","MF_x003a_ BEST CUDDLING 99EC30N2'S":"NEW 24-XTD85-20","010":"010","24_x002e_00":"24.00"},{"...}]

3. I added an "Apply to each" action, and up at the top of the FLOW I added a variable ("ROW_COUNTER") that will track the number of rows iterating through the apply to each, starting at zero (0).
4. Within the "Apply to each", I added a conditional to check the value of "ROW_COUNTER", and if its 0, i know its the first row, and get the header values from the first row in the array (like above).

NOTE: LESSON LEARNED - MS FLOW will not allow you to iterate through an output array using an index, like outputs('List_rows_present_in_a_table')?[0] - you can ONLY use a string key to get the value, WHY????????? I understand MS FLOW is not supposed to be bound by typical programming language contructs, but come on! Why use variables then, or data types, like array, string, boolean, etc, are they not programming language constructs??????

Because of the nonsense above I had to a) convert the entire array to a string, b) remove the array start and end characters ([ ]), c) split on comma ',' to turn the rows back into an array variable I created. I then take the header values out and put them in a data array and (tried to) assign that array to an array of all the rows. But wait for it...

NOTE: LESSON LEARNED - MS FLOW will not (easily) allow you to add an array to another array. I did find an article that tried to explain how to do it with the "Select" action, but i couldn't get it to work, there is literally a MS FLOW error returned that says you can't add an array to array, only string, boolean, etc, literally any OTHER data type, WHY????????? You couldn't allow one more data type to be added to an array??????

This is so convoluted, but here goes. So eventually I end up with an array of strings, where the strings represent the rows. I add an "Apply to each", and then for each string row I a) split again on comma, ',', so I have an array of each key value pair from the row, then to get the value I want, I can now use an index on the row array (variables('ROW_DATA')?[0]), I b) and split on colon ':', and if the its the first row, I use conditional and use first with split [ first(split(variables('ROW_DATA')?[0]), ':') ] to get the key on the left side of the colon the value I want from the header, then I come out of the conditional, and just let it run in the "Apply_to_each" action normally, but use last with split [ last(split(variables('ROW_DATA')?[0]), ':') ] then take the value on the right side of the colon to get the normal value I want from the row.


I can't use Azure functions, and I can't use Excel OFFICE SCRIPTS in the "AUTOMATE" tab, everything I do is with the built-in MS FLOW Triggers and Actions, so I am limited in my choices and have to get creative to do what the business needs.

Again, I do realize MS FLOW is for business people and its not supposed to be a programming language, but there are definitely things that are inherent in MS FLOW that programming-ish, and I think MS FLOW is kind of in a situation where it doesn't really know what it wants to be at this point, and has good intentions but then doesn't add things that make sense and make it easier for people, and then of course they tell you to put in a request for a feature if something doesn't work the way (IMHO) it should. The above was very painful, but it works, if you want more detail I can share what the FLOW looks like, and THERE MUST BE a better way...but it works for now.

Thank you so match!
You save a lot of my time 🙂

Agreed with the reply above mine - THANK YOU SO MUCH for this trick, as it saved tons of time for me and solved this 5-month puzzle for me!!! I can finally sleep well now. 😁

Thank you very much for sharing this with us. I am trying to replicate this and I run into a problem, every time I try to run the offset I get an error saying: the argument is invalid, not found, or is malformed. Doing my tests I realized that the problem is having the subtotal function nested inside the offset. If I remove subtotal and manually add the number of rows everything works fine. Any suggestion?




First thing is lets see what is returned on the spreadsheet itself by the SUBTOTAL formula;


Here is some fake data, and inside the sheet I set the subtotal formula for the sheet in cell O16;




Here it is above with 13 rows of data and 1 header row And it gives me back 14 total rows. 




Here it is above with one row of data and 1 header row, and it returns 2 total rows.


Now Run the subtotal formula on your data and see what it returns. Remember, you probably don't want to run it underneath the data in a column you are already using for your data, run it in a column 1 or 2 columns over from the last column used in the data like I do above. Let me know what happens.

Hi, cindyc. Thanks for the reply. The test that you comment has already been carried out and these are the results:







Perfect. Now we need to test the OFFSET with the SUBTOTAL inside the spreadsheet.


Take a look at this.  When you add in the last two optional OFFSET parameters, [height], and [width],

running OFFSET like this in a cell, won't necessarily return anything meaningful, in fact it might always return the #VALUE error like below;


Here is what happened when i tried =OFFSET(Sheet1!A1,0,0,SUBTOTAL(103, $A:$A),14)




But in this case, I'm not too worried about that because I really just want to see the range of values that this OFFSET, using [height] and [width], is giving me.  The way we check that is to go into the cell where the OFFSET formula is, select in the cell starting before the = (equals sign) and select to the end of the formula, like below. 





Now hit the ctrl-alt-f9 keys simultaneously.  This will actually show you the range of data that is returned from the offset, right inside the formula entry box;




Now using your SUBTOTAL in the OFFSET, see what this returns.  Keep in mind if any of the cells in the first row of the data range are empty, it will throw everything off.  If you select an extra row outside of the actual data, it may error out, same with the columns.


Also, if it errors out again with the SUBTOTAL inside the OFFSET, there should be a little error check icon next to the formula;




Click this and select "Show Calculation Steps" - it will show you the actual value that is returned from the SUBTOTAL call in the OFFSET;




Do this and let me know what happens, if you would. I'm very curious as to why the SUBTOTAL isn't working for you.



Hi @ecooney007 


Thank you for this Offset Trick It saves a Lot of time for me.

I need your Assistance in your Offset Expression


When I Change the Value of "103" to something Else My Flow Throws an Error.


The argument is invalid or missing or has an incorrect format.
clientRequestId: 532bbf84-0c0f-490a-83af-29d3a81ef2a8
serviceRequestId: ed480924-697e-491a-8a8c-22281f86f0ca


I am not able to figureout what's Wrong with this.


Can you help

I'm not a my computer right now, just phone, but the value 103 is kind of like a subcommands for the subtotal, and it only allows certain values;

Check out this link for a detailed explanation.


Valid subtotal values;
1 - 11 ignore filtered-out cells, but include manually hidden rows.
101 - 111 ignore all hidden cells - filtered out and hidden manually.


Function_num Function Description
1 101 AVERAGE Returns the average of numbers.
2 102 COUNT Counts cells that contain numeric values.
3 103 COUNTA Counts non-empty cells.
4 104 MAX Returns the largest value.
5 105 MIN Returns the smallest value.
6 106 PRODUCT Calculates the product of cells.
7 107 STDEV Returns the standard deviation of a population based on a sample of numbers.
8 108 STDEVP Returns the standard deviation based on an entire population of numbers.
9 109 SUM Adds up the numbers.
10 110 VAR Estimates the variance of a population based on a sample of numbers.
11 111 VARP Estimates the variance of a population based on an entire population of numbers.


Try one of these valid numbers and let me know what happens.


Thank you ecooney! You saved my life 😁 I done some adjustments and it works great.

Great Solution!  What would the Offset look look like if you need your table to start at Row 8?

Ive put =OFFSET(Sheet1!A8,0,0,SUBTOTAL(103,Sheet1!$A:$A),14)

and the table is created but with 7 extra rows.   

How can I avoid these 7 rows not being included in the Create table?



Legendary. Thank you.

Not applicable

최고에요. 정말 감사합니다. 

Absolutely brilliant!

You saved my life!

Helpful resources


Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (2,338)