Results 1 to 2 of 2

Thread: calculate sum of three numbers where the answer should be zero

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    20
    Rep Power
    0

    calculate sum of three numbers where the answer should be zero

    Hi guys,

    I am stuck into a following thing i have 3 amount where i need to calculate the sum of three amount and the answer should be zero i tried using loop but no sucess any suggestion would be appreciated

    Code:
    Do
    If lp = 0 Then
    amt = net_receipt_amt - Net_Charges_amt - Net_Income_amt
    ElseIf lp = 1 Then
    amt = net_receipt_amt + Net_Charges_amt - Net_Income_amt
    ElseIf lp = 2 Then
    amt = net_receipt_amt + Net_Charges_amt + Net_Income_amt
    ElseIf lp = 3 Then
    amt = -net_receipt_amt + Net_Charges_amt + Net_Income_amt
    ElseIf lp = 4 Then
    amt = -net_receipt_amt + Net_Charges_amt + Net_Income_amt
    ElseIf lp = 5 Then
    amt = -net_receipt_amt - Net_Charges_amt + Net_Income_amt
    ElseIf lp = 6 Then
    amt = -net_receipt_amt + Net_Charges_amt - Net_Income_amt
    End If
    If amt = 0 Then Exit Do
    lp = lp + 1
    Loop
    You are going to have to provide a more detailed description of what your setup is and what you are trying to do with it... what you have posted is not clear to me at all.
    Last edited by Rick Rothstein; 04-24-2013 at 02:26 PM.

  2. #2
    Member
    Join Date
    Nov 2011
    Posts
    41
    Rep Power
    0
    Can yu please explain more as it is not clear what to do. It would be better if you can provide somthing with sample data with workbook.



    regards
    Prince

Similar Threads

  1. Macro To Calculate Percentage Allocation
    By Howardc in forum Excel Help
    Replies: 3
    Last Post: 06-01-2013, 01:59 PM
  2. Replies: 2
    Last Post: 03-31-2013, 01:54 PM
  3. Calculate Time Difference Between Time In HH:MM
    By Stalker in forum Excel Help
    Replies: 8
    Last Post: 03-28-2013, 03:27 PM
  4. Calculate the Hours
    By leopaulc in forum Excel Help
    Replies: 2
    Last Post: 02-27-2013, 02:51 PM
  5. Replies: 0
    Last Post: 09-07-2012, 09:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •