web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy only certain rows...
Power Automate
Answered

Copy only certain rows to a second spreadsheet

(0) ShareShare
ReportReport
Posted on by 13

Hello,

 

I am new to Power Automate Desktop and and i am building a flow to automate some tasks in excel and i am stuck. For one of my subflows I have 1 spreadsheet with 30000 rows with product codes and their sales figures. I only need 4 of the item codes to be copied over to a new spreadsheet with all their columns data too. The main Spreadsheet will be updated every month so the products might change their row number. How can i do this? thank you

  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    Can you show us what you have so far?

     

    Essentially you'll need to get your Excel data, loop through it, and have conditional statements that look for the codes you care about, and when it finds them, capture the data.

  • Verified answer
    momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @deeacz 

    For such large data sets I am always using SQL query - much faster, cleaner

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-excel

     

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    You don’t need powerautomate. We will set this up once, and you never have to set it up again, you just copy the new 30k row report, drop it in the first tab, and the subset tab will lookup data in the first tab. 


    I’m going to simplify this, you just need to do this for however many columns there are. Let’s say I have product code in column A and sales numbers in column B. 

    Create your new tab

    identify your primary key (product code)

    manually enter (or copy over) all 4 product codes

    In this case, that’s in column A. (A2-A5). 
    if you have any decent excel, you should have an XLOOKUP function. In B2, you would have the following formula:

    =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

    so it would look like this:

    =XLOOKUP($A2, Maintab!’$A:$A, Maintab!’B:B,,0,)

     

    this will find the product code in A2 and bring over the proper value from column B on the main tab to populate column B on the subset tab. 

    Notice the $. Column A doesn’t change (you always want to reference the product code, but the row does and the column you are pulling data from does. 

    you can copy this down, and if there were more columns, you could copy it right. 

    for xlookup, the primary key doesn’t have to be on the left. If you don’t have xlookup, you have to use vlookup. It’s similar, but you can only pull data to the right of product code. If you need help with that, let me know. 

    good luck!

  • CU09091411-0 Profile Picture
    13 on at

     @momlo thank you for you help. this looks like a clean solution, i just need to get my head around it

  • CU09091411-0 Profile Picture
    13 on at

    i always use excel for these type of searches and now trying to introduce a few power automate processes i completely ruled out the fact i can just do this in excel - connect the formula to the main spreadsheet i update through power automate . thanks 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard