Avatar of Luis Diaz
Luis Diaz asked on

Excel Formula: sumif based on semi-colon-separator V2

Hello experts,
I have the following sheet.
I would like to set up sumif formula in order to take as a reference process delimited with ; separator.
I attached dummy file:
delim.pngInstead of reporting manually the values concerned in the sum I would like to read the values reported as of range A15 delimited by ";" and perform the sum as of column B16.
If you have questions, please contact me.
Sumif-based-on-semi-colon-separator.xlsx
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Luis Diaz

8/22/2022 - Mon
Rob Henson

See attached, with similar way of solving to previous question.

I have included previous version as well on sheet1
Sumif-based-on-semi-colon-separator.xlsx
Ejgil Hedegaard

You can use this formula in B15
=SUMPRODUCT((ISERROR(FIND($B$2:$B$7&";",A15&";"))=FALSE)*$C$2:$C$7)

Open in new window

ASKER
Luis Diaz

Thank you Ejgil.
Formula works for values from 1-9 however when I report a value superior than 10 example 11 the value is not properly displayed.
 I attached my reference file in which I set up the proposed formula in 2-Key-Actions with screenshot from 1-Specific-Actions.
As you can see when I report value 11 and I got 8.6, instead of having 3.6.
sum-product.pngThank you in advance for your help.
Sum-product-test_20122018.xlsx
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Rob Henson

The 8.6 is because its taking the time for process 1 and the time for process 11 (1=5 plus 11=3.6, result 8.6)
Rob Henson

Does your process identifier have to be numeric?

Would a change in process to using process identifier A to Z be feasible?

A numeric identifier is currently limiting you to 10 processes (0 - 9) whereas an alphabetic identifier would increase that limit to 26.
ASKER
Luis Diaz

Ok, thank you for this feedback, in that case I can rename A1,A2... however I was wondering if there is a way to review the formula to be applied for the various numeric values?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Rob Henson

See attached with my suggestion for just alphabetic process identifier; this still uses the helper columns as before.

By the way, it would have helped if you had given all of the conditions from the start rather than changing part way in to the question.
Sum-product-test_20122018.xlsx
ASKER CERTIFIED SOLUTION
Ejgil Hedegaard

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Luis Diaz

Thank you very much. Unable to test it now. I will keep you informed.
Rob Henson

Tested Ejgil's suggestion with multiple occurrences of the same process in the string in column E and it only counts each process once. For example, if E4 was "11;11" rather than just 11 the result is still 3.6 rather than 7.2 for two occurrences.

See attached.
Column H creates a string which converts all numbers within the string to a string starting with an underscore and ending with a semi-colon. Thus 11 becomes "_11;" (without the quotes). This is then distinguishable from an entry of 1 as that becomes "_1;".

The helper columns (I to AH) then find the specific string for the number in row 1 and replace them with "_;" which reduces the length of the string by removing the number in row 1.

The comparison of original length to reduced length then determines how many occurrences of the particular number have been removed. Where the number in row 1 is more than one digit, the reduction has to be divided by the number of digits as that is how many occurrences of that number have been removed.

The result of the occurrences calculation is then multiplied by the relevant value from the process list.

I am thinking that if the logic applies for 1 or 2 digit numbers, I don't see a reason why it wouldn't work beyond 2 digits.
Sum-product-test_20122018.xlsx
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Rob Henson

If you don't like the idea of helper columns but you need multiple occurrences counted then I suspect you will have to use VBA in a User Defined Function which looks at the string in column E and splits it at each occurrence of the semi-colon to form an array of numbers which is then compared to the table for the relevant values against each.

That is beyond my VBA/UDF knowledge but am aware that there are experts on here that would be able to do that.
ASKER
Luis Diaz

Thank you very much Rob for your proposals.
ASKER
Luis Diaz

The number of process cannot be reported twice in the reference colum as a result this will not be a problem.
This will be the last requirement, possible to return "Unable to sum as process reported are not unique".
Thank you again for your help.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
Luis Diaz

I added "P" at the beginning of the string in order to avoid this problem with number above 9. and it works.
Even if process is repeated twice the sum will be performed once.
Thank you again for your help.