Formula for grabbing a heading

mant3220

New Member
Joined
Oct 4, 2014
Messages
2
I apologize in advance for the uninformative title.

I am compiling a sales by customer list and the raw data is quite long (20,000 rows) so I need a single formula that can be copied all the way down. The raw data has the customer name in column A and a list of sales numbers in column B and the last row is always the total for all the sales numbers above it.

What I need is a formula in column C that will grab the customer name and a formula in column D that will equal the total. The number of rows between the customer name and the total is different for each customer.

I have made an excel that explains this problem better but cannot find a way of attaching it.

Thanks in advance for any help you can offer.
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

dermie_72

Well-known Member
Joined
Sep 4, 2012
Messages
1,540
Your explanation is not clear, but im willing to take a stab in the dark, and guess at what you want.
C = copy column A
Paste in C
Highlight C - Data/remove duplicates
Column D1 = Sumif(A:A,C1,B:B)
Copy down

Best guess based on the information you have provided.
 

mant3220

New Member
Joined
Oct 4, 2014
Messages
2
How do I link an excel spreadsheet or a picture?

The problem for column C is that the customer name is always in the row containing the first transaction for that customer whereas the total value can be any number of rows down depending on the number of transactions for the customer. Putting the customer name in the same row is the difficulty.

I apologize for the unclear explanation.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,608
Messages
5,597,143
Members
414,129
Latest member
mr vba

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
Top