extract data from sheet2 into sheet1

Just2learn

New Member
Joined
Feb 16, 2011
Messages
11
I have a workbook with two sheets. Sheet1 is simple it has a list of customers and a total column. Sheet2 has all the customers data. I need to pull the total by customer from sheet2 into sheet1. The problem I am having is the customer total cell on sheet2 is not always in the same place. i.e. the data may be on one line as in A ONE FURNITURE, or more than one as in the STARSHINE BEST line.

A ONE FURNITURE LLC 332.79
CUSTOMER TOTAL: 332.79

STARSHINE BEST LLC AR2198-0209 72129 619.94
STARSHINE BEST LLC FREIGHT CHARGE/P 721289 0
STARSHINE BEST LLC GA1803-0214 72240 1805.64
STARSHINE BEST LLC FREIGHT CHARGE/D 72239L 0
STARSHINE BEST LLC MI2203-0307 72486 328
STARSHINE BEST LLC FREIGHT CHARGE/P 724850 0
CUSTOMER TOTAL: 2753.58

BACKYARD PLEASURES 3963 72330 639
BACKYARD PLEASURES 3963 72331 8434.48
BACKYARD PLEASURES FREIGHT CHARGE/P72329 0
BACKYARD PLEASURES 3963 72420 3592.34
CUSTOMER TOTAL: 12665.82

I need to pull these customer totals into sheet1 that matches the customers name. There may be as many 900 customer names on sheet1. Any help would be greatly appreciated.....
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hello,

In Sheet2 are all data in one col. say A:A? Or customers in Col A & Totals in Col B?
 
Upvote 0
Hi, the customers are listed in column B, and the totals are in column F. However in column F there may be numerous dollar figures each in a different row and a grand total at the bottom. Is there an easy way to post a snapshot of sheet2 in this thread?

Steve
 
Upvote 0
Assume in Sheet2 B:B is the customer & down 'CUSTOMER TOTAL' & col F is the amounts.

Sheet1 A2 to down is the customer names, B2 copy down

=INDEX(INDEX(Sheet2!F:F,MATCH(A2&"*",Sheet2!B:B,0)):Sheet2!$F$65536,MATCH("Customer Total*",INDEX(Sheet2!B:B,MATCH(A2&"*",Sheet2!B:B,0)):Sheet2!$B$65536,0))

See my signature block. It will tell you how to post a snapshot of your sheet.
 
Last edited:
Upvote 0
WOW this looks like a lot. I will give this a try. I am impressed how quickly you threw this together. thanks for the info and I will post my results and if I can't get it to work I will post sheet2 for you to see. Thanks...
 
Upvote 0
I keep getting the #N/A error. Posted is sheet2, I hope i did it correctly. It starts with column A. Please let me know if theres anything i can do to assist you in helping me. Thanks alot...

Steve
Excel Workbook
ABCDEFGHIJ
1Page:1SUMMARY SALES ANALYSISReport Generated On: 05/20/20011
2==================================================================================================================
3A ONEA ONE FURNITURE LLC23172219332.790332.790%
4CUSTOMERTOTAL:332.790332.790%
5
6STABESSTARSHINE BEST LLCAR2198-020972129619.940619.940%
7STABESSTARSHINE BEST LLCFREIGHT CHARGE/P7212890000%
8STABESSTARSHINE BEST LLCGA1803-0214722401805.6401805.640%
9STABESSTARSHINE BEST LLCFREIGHT CHARGE/D72239L0000%
10STABESSTARSHINE BEST LLCMI2203-03077248632803280%
11STABESSTARSHINE BEST LLCFREIGHT CHARGE/P7248500000%
12CUSTOMERTOTAL:2753.5802753.580%
13BACPLEBACKYARD PLEASURES39637233063906390%
14BACPLEBACKYARD PLEASURES3963723318434.4831.68402.8899.63%
15BACPLEBACKYARD PLEASURESFREIGHT CHARGE/P723290000%
16BACPLEBACKYARD PLEASURES3963724203592.3403592.340%
17CUSTOMERTOTAL:12665.8231.612634.2299.75%
18
19PATBONPATIO BONANZA0207-2527259927.5203.25-175.750%
20CUSTOMERTOTAL:27.5203.25-175.750%
21
22GRAND TOTAL ALL:556863.4630349.13526514.3394.55%
Sheet2
Excel 2007
 
Upvote 0
This is sheet1 layout....
Excel Workbook
AB
1Nametotal
2A ONE FURNITURE LLC
3A ONE FURNITURE LLC
4A&A DISTRIBUTORS
5AARON FEBER
6ABRAHAM GEORGE INC
7ABRAHAM GEORGE INC
8***do not use***
9ALLSTAR POOL AND SPA #2151
10ALONG CAME MARY
11BACKYARD PLEASURES
12AMERICAN POOL #215253
13PATIO BONANZA
Sheet1
Excel 2007
 
Upvote 0
Haseeb, I did get results, I did not notice i had customer and total in two different cells, when I moved "customer total to column B it pulled the data. Does "customer total have to stay in column B or can that be in a different column? Thank you for such a quick reply and a solution that extracted the data. Nice job...

Steve
 
Upvote 0
B2, copy down.

=IFERROR(INDEX(INDEX(Sheet2!F:F,MATCH(A2&"*",Sheet2!B:B,0)):Sheet2!$F$65536,MATCH("Total*",INDEX(Sheet2!D:D,MATCH(A2&"*",Sheet2!B:B,0)):Sheet2!$D$65536,0)),0)

Also,

A simple SUMIF would do it.

=SUMIF(Sheet2!B:B,$A2,Sheet2!F:F)
 
Last edited:
Upvote 0
Sir it works like a charm and I did not have to modify my sheets at all...Thank you ever so much for your help.

Steve
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top