using sumproduct and substring text comparion

jdcarroll15

New Member
Joined
Sep 4, 2009
Messages
2
I have been searching for a way to utilize sumproduct with a substring comparison of a text field. That in of itself is easy enough. What I need is to find a substring value that appears at the end of the text field rather than just finding the substring value in the text field. As an example...

A
B
dir1/file1
12
dir2/fileB
250
dir2/file12
44
dir3/file1
8

<TBODY>
</TBODY>









In this example I want to accumulate all of the values in column B where the filenames - not the directory names - exactly match. From what I think I already know, search, find and match will not work since they will match my search string in the text field no matter where it's at. That would be a problem when I'm trying to match file1, i don't want the entry for file12 to be picked up in my total for file1. The end result would look like...

A
B
file1
20
file12
44
fileB
250

<TBODY>
</TBODY>







I am starting to contemplate using a helper field but would rather try to get this in the sumproduct formula directly. One other option I will try is actually using search with the start position being the length of the text field - the length of my criteria. Maybe this is the route I have to go, but I'd like to hear back if anybody has any better or other suggestions.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
This is a good idea but it is making the assumption that I hardcode the filenames on sheet2. I'd rather not do that as in my spreadsheet I have about 2000 entries to process thru. I want to make it more dynamic in nature which is why I'm using the sumproduct function.
 
Upvote 0
This is a good idea but it is making the assumption that I hardcode the filenames on sheet2. I'd rather not do that as in my spreadsheet I have about 2000 entries to process thru. I want to make it more dynamic in nature which is why I'm using the sumproduct function.

Not sure what you are heading. If the files are not available with the figures (numbers) they are associated with, will a SumProduct formula won't do anything better than a SumIf formula.
 
Upvote 0

Forum statistics

Threads
1,203,462
Messages
6,055,565
Members
444,799
Latest member
CraigCrowhurst

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