+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 : Calculation on the basis of IF

  1. #1
    Registered User
    Join Date
    09-10-2011
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    13

    Calculation on the basis of IF

    Can anyone pls assit me on it. It would be most appreciated.

    In excel i have to calculate gross weight..gross weight is "net weight+tare weight".
    The net weight of a bag could be 50 lb or 25 kg..however the tare weight is always 0.3 kg..if the unit is "kgs" then its obvious that this is 25 kg per bag, and if its "lbs" then for sure its 50 lb per bags.
    One more thing, if the code is "rtc" or "ipi" then the conversion from kg to lb will be "2.205", however if the code is other then these two, conversion will always be "2.2"


    S. No. | Code | No. Of Bags | Unit | Net Weight | Gross Weight

    1--------PPI--------800--------KGS--------20000-------- __________
    2--------PPI--------800--------LBS--------20000-------- __________
    3--------RTC--------800--------KGS--------20000-------- __________
    4--------RTC--------800--------LBS--------20000--------__________
    5--------IPI--------800--------KGS--------20000--------__________
    6--------IPI--------800--------KGS--------20000--------__________
    7--------SOM--------800--------KGS--------20000--------__________
    8--------SOM--------800--------KGS--------20000--------__________
    9--------BNS--------800--------KGS--------20000--------__________
    10--------BNS--------800--------KGS--------20000--------__________

    many thanks in advance!
    Last edited by habibian88; 09-19-2011 at 04:35 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Calculation on the basis of IF

    Can you supply a couple of manually calculated values to help test if formulae are giving the correct answers.
    Martin

  3. #3
    Registered User
    Join Date
    09-10-2011
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculation on the basis of IF

    Quote Originally Posted by mrice View Post
    Can you supply a couple of manually calculated values to help test if formulae are giving the correct answers.
    Thank you for your reply, i had made a few mistakes in last scenario, here is the corrected one along with Gross Weight.

    S. No. | Code | No. Of Bags | Unit | Net Weight | Gross Weight

    1--------PPI--------800--------25 KG--------20000 KGS-------- 20240 KGS
    2--------PPI--------800--------50 LB--------40000 LBS-------- 18400 KGS
    3--------RTC--------800--------25 KG--------20000 KGS-------- 20240 KGS
    4--------RTC--------800--------50 LB--------40000 LBS--------18358 KGS
    5--------IPI--------800--------25 KG--------20000 KGS--------20240 KGS
    6--------IPI--------800--------50 LB--------20000 KGS--------18358 KGS
    7--------SOM--------800--------25 KG--------20000 KGS--------20240 KGS
    8--------BNS--------800--------25 KG--------20000 KGS--------20240 KGS

    LB to KG conversion is "2.2" for all the Codes except "RTC" and "IPI"; for these two is "2.205".
    Look forward to your response.

  4. #4
    Registered User
    Join Date
    09-10-2011
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculation on the basis of IF

    Quote Originally Posted by mrice View Post
    Can you supply a couple of manually calculated values to help test if formulae are giving the correct answers.
    I am extremely sorry, just noticed another correction.....the Tare Weight of LB bags is "0.6 LB" and KG bags is "0.3 KG", previously i told that tare weight is always is "0.3 KG".

    for your reference, here is the Gross Weight Calculation of S. No. 1, 2 & 4;

    S. No. 1.
    No. of Bags.............................800
    Weight per Bag........................25 KG
    Net Weight...............................20000 KGS (800x25)
    Tare Weight...............................240 KGS (0.3x800)

    Gross Weight is Net Weight + Tare Weight and is always in KGS.

    Gross Weight Final.....................20240 KGS

    S. No. 2:
    No. of Bags.............................800
    Weight per Bag........................50 LB
    Net Weight...............................40000 LBS (800x50)
    Tare Weight...............................480 LBS (0.6x800)

    Gross Weight is Net Weight + Tare Weight and is always in KGS.

    Gross Weight.............................40480 LBS
    Gross Weight Final....................18400 (40480/2.2)--"2.2" is the conversion for all codes except "RTC" and "IPI"..

    S. No. 4:
    No. of Bags.............................800
    Weight per Bag........................50 LB
    Net Weight...............................40000 LBS (800x50)
    Tare Weight...............................480 LBS (0.6x800)

    Gross Weight is Net Weight + Tare Weight and is always in KGS.

    Gross Weight.............................40480 LBS
    Gross Weight Final.....................18358 (40480/2.205)--"2.205" is the conversion for "RTC" and "IPI"..

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Calculation on the basis of IF

    This formula doesn't give exactly the same answers as you manual calculations but seems to fit with my understanding of your explanation.

    =IF(RIGHT(E1,3)="KGS",LEFT(E1,LEN(E1)-4)+(C1*0.3) & " KGS",IF(OR(B1="RTC",B1 = "IPI"),INT((LEFT(E1,LEN(E1)-4)/2.205)+(C1*0.3)) & " KGS",INT((LEFT(E1,LEN(E1)-4)/2.2)+(C1*0.3)) & " KGS"))

    Paste this into a cell in the first row and copy down.

  6. #6
    Registered User
    Join Date
    09-10-2011
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculation on the basis of IF

    Quote Originally Posted by mrice View Post
    This formula doesn't give exactly the same answers as you manual calculations but seems to fit with my understanding of your explanation.

    =IF(RIGHT(E1,3)="KGS",LEFT(E1,LEN(E1)-4)+(C1*0.3) & " KGS",IF(OR(B1="RTC",B1 = "IPI"),INT((LEFT(E1,LEN(E1)-4)/2.205)+(C1*0.3)) & " KGS",INT((LEFT(E1,LEN(E1)-4)/2.2)+(C1*0.3)) & " KGS"))

    Paste this into a cell in the first row and copy down.
    Dear,
    Can you pls apply it on the attached File and send back to me..
    Many thanks.
    Attached Files Attached Files

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Calculation on the basis of IF

    Another way of looking at your problem
    Insert a column between "Net Weight" & "Gross Weight"

    Then
    In E2
    Please Login or Register  to view this content.
    In F2
    Please Login or Register  to view this content.
    In G2
    Please Login or Register  to view this content.
    Drag/Fill all down

    Format Column G "Gross Weight"
    Number Format > Custom >
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Calculation on the basis of IF

    Your sample workbook is different from what your sample in post #3 suggested
    In G1
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-10-2011
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculation on the basis of IF

    Quote Originally Posted by Marcol View Post
    Your sample workbook is different from what your sample in post #3 suggested
    In G1
    Please Login or Register  to view this content.
    Great...Thanks very much..

  10. #10
    Registered User
    Join Date
    09-10-2011
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculation on the basis of IF

    Quote Originally Posted by Marcol View Post
    Another way of looking at your problem
    Insert a column between "Net Weight" & "Gross Weight"

    Then
    In E2
    Please Login or Register  to view this content.
    In F2
    Please Login or Register  to view this content.
    In G2
    Please Login or Register  to view this content.
    Drag/Fill all down

    Format Column G "Gross Weight"
    Number Format > Custom >
    Please Login or Register  to view this content.
    Great..thanks very much..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1