Hello all,
I've stared at this formula way too long and can't find the error. I'd appreciated some fresh eyes to find the problem.
In a cell, I have a 15 digit value that, when broken into sections, represents different information. Here's the break down of parts:
Cell E2 = 200002000000000
Digits 2-5 = "0000" is % of Coin - expl 0360 = 3.6%
Digits 6-9 = "2000" is % of Revenue - expl 0500 = 5.0%
Digits 10-14 = "00000" is Daily Fee in $ - expl 07500 = $75
Digits 1 and 15 are not significant for my purpose. The formula I was using worked, until I added a MAX function to take the larger of either (a) % of Rev or (b) $35/Day for digits 6-9. Fees for some of the equipment we lease is either 20% of Rev or a mininum of $35/day used. Here's an example of the data, and the formula I'm currently struggling with.
A B C D E
1 Coin Revenue Days Code Correct Calc
2 80,000 12,000 30 200002000000000 2,400
3 80,000 5,000 30 200002000000000 1,050
4 100,000 7,500 30 300000000075000 2,250
5 150,000 25,000 30 104900000000000 7,350
=IF(VALUE(D2)=0,0,IF((RIGHT(LEFT(D2,5),4)/10000)>0,((RIGHT(LEFT(D2,5),4)/10000)*A2),IF((RIGHT(LEFT(D2,14),5))>0,((RIGHT(LEFT(D2,14),5))/100*C2),IF((RIGHT(LEFT(D2,9),4)/10000)>0,MAX((RIGHT(LEFT(D2,9),4))/10000*B2,C2*35),0))))
I know it's a mouthful, but if someone wouldn't mind glancing it over, I'd appreciate it. I can get it to work correctly for one calc type, but not another. I'll make a change, then it works for the second, but not the first. I haven't been able to get it to work for all combinations.
Thanks in advance for your assistance.
Scott
I've stared at this formula way too long and can't find the error. I'd appreciated some fresh eyes to find the problem.
In a cell, I have a 15 digit value that, when broken into sections, represents different information. Here's the break down of parts:
Cell E2 = 200002000000000
Digits 2-5 = "0000" is % of Coin - expl 0360 = 3.6%
Digits 6-9 = "2000" is % of Revenue - expl 0500 = 5.0%
Digits 10-14 = "00000" is Daily Fee in $ - expl 07500 = $75
Digits 1 and 15 are not significant for my purpose. The formula I was using worked, until I added a MAX function to take the larger of either (a) % of Rev or (b) $35/Day for digits 6-9. Fees for some of the equipment we lease is either 20% of Rev or a mininum of $35/day used. Here's an example of the data, and the formula I'm currently struggling with.
A B C D E
1 Coin Revenue Days Code Correct Calc
2 80,000 12,000 30 200002000000000 2,400
3 80,000 5,000 30 200002000000000 1,050
4 100,000 7,500 30 300000000075000 2,250
5 150,000 25,000 30 104900000000000 7,350
=IF(VALUE(D2)=0,0,IF((RIGHT(LEFT(D2,5),4)/10000)>0,((RIGHT(LEFT(D2,5),4)/10000)*A2),IF((RIGHT(LEFT(D2,14),5))>0,((RIGHT(LEFT(D2,14),5))/100*C2),IF((RIGHT(LEFT(D2,9),4)/10000)>0,MAX((RIGHT(LEFT(D2,9),4))/10000*B2,C2*35),0))))
I know it's a mouthful, but if someone wouldn't mind glancing it over, I'd appreciate it. I can get it to work correctly for one calc type, but not another. I'll make a change, then it works for the second, but not the first. I haven't been able to get it to work for all combinations.
Thanks in advance for your assistance.
Scott