# Sum numbers in a column if values in another column contain the number in another cell

1. ## Sum numbers in a column if values in another column contain the number in another cell

I've tried SUMIF, SUMIFS, SUMPRODUCT (with SUMIF) but the problem here seems to be CONTAINS. You can do this for text using wildcard ** but not numbers. How would I do this?

Example:

Sum column D if Column B (which are two sets of numbers) contains cell H5 (which is a number)

2. ## Re: Sum numbers in a column if values in another column contain the number in another cell

Without sample, just guess:

=SUMPRODUCT(ISNUMBER(SEACH(H5,B1:B100))*D1:D100)

with 2 sets of number is in single cell in B1:B100, lookup number is in H5, sum value is in D1:D100

3. ## Re: Sum numbers in a column if values in another column contain the number in another cell

Thank you for your reply, but that did not work. I will include some screenshots.

I actually have 2 workbooks. Workbook #1 contains the #'s (column H) I need to find on Workbook #2 column B. You can see in column B, there are two sets of numbers in each cell. So I need to find all cells in column B that contain the same number from Workbook #1's column H. Once I have found those, I need to sum the numbers in Workbook #2's column D that match Workbook #1's column H (H5, for example, and so on).

Screen Shot 2020-10-17 at 11.15.48 AM.png

Screen Shot 2020-10-17 at 11.15.35 AM.png

4. ## Re: Sum numbers in a column if values in another column contain the number in another cell

Hi and welcome to the forum

Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

To attach a file to your post,
click advanced (next to quick post),
scroll down until you see "manage file",
click that and select "add files" (top right corner).
click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

Once the upload is completed the file name will appear below the input boxes in this window.
You can then close the window to return to the new post screen.

There are currently 1 users browsing this thread. (0 members and 1 guests)