Sum Vlookup each small value for 1 string

Excelpromax123

Board Regular
Joined
Sep 2, 2021
Messages
167
Office Version
  1. 2010
Platform
  1. Windows
Hi guys. I need the formula to add each value according to the figure described below. Please help

1661702368076.png
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
In cell F4 I use the formula on the spreadsheet, it's ok. But when I switch to the code, it doesn't work properly, please fix the code

f4=SUMPRODUCT(ISNUMBER(SEARCH(""&$B$4:$B$12&"",""&E4&""))*$C$4:$C$12)

Sub test()
Dim rng
Set rng = Range("B4:c12")
With Range("e4:e8")
.Offset(, 1).Value = Evaluate("SUMPRODUCT(ISNUMBER(SEARCH(""&rng.Address&"",""&E4&""))*.Address)")
End With
End Sub
 
Upvote 0
Looks like you have forgotten my request from a couple of days ago. :(
@Excelpromax123

When posting vba code in the forum, please use the available code tags. It makes your code much easier to read/debug. My signature block below has more details. I have added the tags for you this time. 😊


In cell F4 I use the formula on the spreadsheet, it's ok.

f4=SUMPRODUCT(ISNUMBER(SEARCH(""&$B$4:$B$12&"",""&E4&""))*$C$4:$C$12)
Are you sure that formula works? If E6 was 121 instead of 123 that formula returns 120. Shouldn't it return 170 in that case?

Shouldn't it be more like the 'Mine' column?

22 08 29.xlsm
BCDEFG
3Yours Mine
415012120120
527023160160
6390123210210
741509300300
854091350350
963022270210
107160
118210
129300
Sheet5
Cell Formulas
RangeFormula
F4:F9F4=SUMPRODUCT(ISNUMBER(SEARCH(""&$B$4:$B$12&"",""&E4&""))*$C$4:$C$12)
G4:G9G4=SUMPRODUCT(VLOOKUP(MID(E4,ROW(INDIRECT("1:"&LEN(E4))),1)+0,B$4:C$12,2,0))
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

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