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

Luis Diaz
Luis Diaz used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Rob HensonFinance Analyst

Commented:
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
You can use this formula in B15
=SUMPRODUCT((ISERROR(FIND($B$2:$B$7&";",A15&";"))=FALSE)*$C$2:$C$7)

Open in new window

Luis DiazIT consultant

Author

Commented:
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
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Rob HensonFinance Analyst

Commented:
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 HensonFinance Analyst

Commented:
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.
Luis DiazIT consultant

Author

Commented:
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?
Rob HensonFinance Analyst

Commented:
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
Adding a ";" in the find function before the text solve it.
Then 1 will be ";1;" and 11 will be ";11;" in the search.

I tried with a number above 10 before posting, but not enough test :)
Sum-product-test_20122018.xlsx
Luis DiazIT consultant

Author

Commented:
Thank you very much. Unable to test it now. I will keep you informed.
Rob HensonFinance Analyst

Commented:
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
Rob HensonFinance Analyst

Commented:
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.
Luis DiazIT consultant

Author

Commented:
Thank you very much Rob for your proposals.
Luis DiazIT consultant

Author

Commented:
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.
Luis DiazIT consultant

Author

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial