We help IT Professionals succeed at work.

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

71 Views
Last Modified: 2018-12-21
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

Rob HensonFinance Analyst
CERTIFIED EXPERT

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
CERTIFIED EXPERT

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

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
CERTIFIED EXPERT

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
CERTIFIED EXPERT

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
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Luis DiazIT consultant

Author

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

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
CERTIFIED EXPERT

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.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.