merge amounts for each name based on adjacent cell contains TOTAL word

Mussala

Board Regular
Joined
Sep 28, 2022
Messages
61
Office Version
  1. 2019
Platform
  1. Windows
Hi
I look for way to merge amounts for each name based on adjacent cell
in sheet1 every name in column B contains the total value in lastrow in column A contains TOTAL word and correspond amount in column E . so I want matching F2 in sheet2 with column B in sheet1, if it's matched then I want summing the amounts in cell for clumn E where is adjacent for TOTAL cell for the same name and show the result in F5 in sheet2 .
for instance :
Mussaila1=4900+300=5200

aw
ABCDE
1ITEMNAMEINVOICE NOORDER NOAMOUNT
21Mussaila1INA00OR001000
32Mussaila1INA00OR001200
43Mussaila1INA00OR001300
54Mussaila1INA00OR001400
6TOTALMussaila1INA00OR004900
71Mussaila2INA01OR01100
82Mussaila2INA01OR01200
9TOTALMussaila2INA01OR01300
101Mussaila1INA02OR02300
11TOTALMussaila1INA02OR02300
Sheet1


before
aw
F
1NAME
2Mussaila1
3
4AMOUNT
5
sheet2


should be
aw
F
1NAME
2Mussaila1
3
4AMOUNT
55200
sheet2


thank you
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try

Book2
ABCDEFGHIJ
1ITEMNAMEINVOICE NOORDER NOAMOUNTNAME
21Mussaila1INA00OR001000Mussaila1
32Mussaila1INA00OR001200
43Mussaila1INA00OR001300AMOUNT
54Mussaila1INA00OR0014005200
6TOTALMussaila1INA00OR004900
71Mussaila2INA01OR01100
82Mussaila2INA01OR01200
9TOTALMussaila2INA01OR01300
101Mussaila1INA02OR02300
11TOTALMussaila1INA02OR02300
12
13
14
Sheet1
Cell Formulas
RangeFormula
I5I5=SUMIFS($E$2:$E$11,$B$2:$B$11,I2,$A$2:$A$11,"<>Total")
 
Upvote 0
thank you ,but between two sheets , not in the same sheet!
 
Upvote 0
Sheet1

Book2
ABCDEF
1ITEMNAMEINVOICE NOORDER NOAMOUNT
21Mussaila1INA00OR001000
32Mussaila1INA00OR001200
43Mussaila1INA00OR001300
54Mussaila1INA00OR001400
6TOTALMussaila1INA00OR004900
71Mussaila2INA01OR01100
82Mussaila2INA01OR01200
9TOTALMussaila2INA01OR01300
101Mussaila1INA02OR02300
11TOTALMussaila1INA02OR02300
12
13
Sheet1



Sheet2

Book2
DEFGHI
1NAME
2Mussaila1
3
4AMOUNT
55200
6
7
Sheet2
Cell Formulas
RangeFormula
F5F5=SUMIFS(Sheet1!$E$2:$E$11,Sheet1!$B$2:$B$11,F2,Sheet1!$A$2:$A$11,"<>Total")
 
Upvote 0
Awesome !
is there any way to specify the whole column instead of pull the range down?
 
Upvote 0
I suggest to avoide using entire column as it leads to slow operation of data is large size.

Try
Excel Formula:
=SUMIFS(Sheet1!E:E,Sheet1!B:B,F2,Sheet1!A:A,"<>Total")
 
Upvote 0
Seems more logical & efficient to me to add the rows where column A is "Total" rather than all the ones where it is not "Total".
I do agree that whole columns references should not be needed. Just choose a number big enough to cover ant data that you might ever have.

Mussala.xlsm
ABCDE
1ITEMNAMEINVOICE NOORDER NOAMOUNT
21Mussaila1INA00OR001000
32Mussaila1INA00OR001200
43Mussaila1INA00OR001300
54Mussaila1INA00OR001400
6TOTALMussaila1INA00OR004900
71Mussaila2INA01OR01100
82Mussaila2INA01OR01200
9TOTALMussaila2INA01OR01300
101Mussaila1INA02OR02300
11TOTALMussaila1INA02OR02300
Sheet1


Mussala.xlsm
F
1NAME
2Mussaila1
3
4AMOUNT
55200
Sheet2
Cell Formulas
RangeFormula
F5F5=SUMIFS(Sheet1!$E$2:$E$10000,Sheet1!$B$2:$B$10000,F2,Sheet1!$A$2:$A$10000,"Total")
 
Upvote 1
Solution
I suggest to avoide using entire column as it leads to slow operation of data is large size.
understood .;)
thank you for your help :)
 
Upvote 0
Seems more logical & efficient to me to add the rows where column A is "Total" rather than all the ones where it is not "Total".
that's why I mark solution .
I do agree that whole columns references should not be needed.
got it .
thank you so much .:)
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,282
Messages
6,124,052
Members
449,139
Latest member
sramesh1024

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