I'm looking for a way to add the numerical values in a list of string items that have an identifier as it's right character (via formula not VBA), however the length of the numbers can vary !
The real world application for this formula involves adding up overtime shifts hours worked by individuals. We have lots of shift codes denoting number of hours worked and the overtime shifts are marked with a £ as the right character
For example
D8
D12
D12£
D1£
The total hours worked is 33 but I'd like a formula to return the value 13 for just the figures ending in a £
Would it be too much to mention that sometime we have half shifts ?
For example
D8
D12
D12£
D1.5£
So the required value for this would be 13.5
I've been trying to use sumproduct and the nearest I can get is :
I think that the answer lies with sumproduct, but I'm having trouble finding the right comination
The real world application for this formula involves adding up overtime shifts hours worked by individuals. We have lots of shift codes denoting number of hours worked and the overtime shifts are marked with a £ as the right character
For example
D8
D12
D12£
D1£
The total hours worked is 33 but I'd like a formula to return the value 13 for just the figures ending in a £
Would it be too much to mention that sometime we have half shifts ?
For example
D8
D12
D12£
D1.5£
So the required value for this would be 13.5
I've been trying to use sumproduct and the nearest I can get is :
Code:
=SUM(IF(RIGHT(G$34:G$402,1)="£",--LEFT(G$34:G$402,LEN(G$34:G$402)-1))) which #value! errors
or
=SUMPRODUCT((RIGHT(G$34:G$402,1)="£")*(LEFT(G$34:G$402,1)<>"U")) which only counts the total occurrences of the cells containing a £
I think that the answer lies with sumproduct, but I'm having trouble finding the right comination