• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

need a formula/function

Dandapani S

New Member
Hi all,
Good Morning! I need a formula/function to arrive the following solution.
Example:
Input:
Row1:
Value:
A:
B:
C:
D:
E:
Row2:
6602
1600
2705
5155
11970
3870
Required Output:
Row1:
A:
B:
C:
D:
E:
Row2:
1600
2705
2297
0
0
Based on value 6602....A,B,C should be required...if value exceeds, the rest of the coloumn output should be zero....6602=(1600+2705+2297)...pls help
 
hi dandapaniS,
First welcome to Chandoo forum, your post is not clear better you attach a sample file with your post which will be easy for the members to understand your problem.
 
Sorry for the inconvenience caused.....pls see the attched file...i need one value should be spread across columns based on "n" of data...
 

Attachments

ok, but in your sample file at the first row value is 6602, but in green column C you have put 2297, as per your requirement (1600+2705+5155)=9460 which is greater than 6602, so the result must be "0" at here. please clear your query.
 
@Dandapani S

In your uploaded file put below formula in Q7 and copy to U7 and down to Q9.
=IF(SUM(D7:$E7)>$C7,IF($C7<$E7,IF(COUNTIF($P7:P7,">0")=1,0,$C7),0),IF(SUM($E7:E7)<$C7,E7,$C7-SUM(D7:$E7)))

Just advise if any issue.

Regards,
 
Code:
Modified formula because of smiley in last post.
=IF(SUM(D7:$E7)>$C7,IF($C7<$E7,IF(COUNTIF($P7:P7,">0")=1,0,$C7),0),IF(SUM($E7:E7)<$C7,E7,$C7-SUM(D7:$E7)))

regards,
 
Back
Top