+ Reply to Thread
Results 1 to 2 of 2

Truncating problem

  1. #1
    Registered User
    Join Date
    03-19-2015
    Location
    KL, Malaysia
    MS-Off Ver
    Office 2013
    Posts
    1

    Truncating problem

    I'm not a usual excel user but i know excel can do wonders. I tried to used truncate for my assignment in which a price of product is calculated by summing a few components. One of the component is a de-escalation factor depending on quality (viscosity index) of the product.

    "The price is to be reduced by $0.04/unit for each whole one tenth of the viscosity index below 34 down to 27,
    and by $0.06/unit for each whole one tenth of the viscosity index below 27
    and to be increased by $0.04/unit for each whole one tenth of the viscosity index above 34"

    My product has viscosity index of 26.60. My manual calculation is like below:

    ((27-34)*10*$0.04)) + ((26.60-27)*10*$0.06)): -$3.04

    I tried to put in excel formula as below but the result is not the same:

    IF(I8>=34,TRUNC((34-I8)/0.1,0)*-0.04,IF(I8>=27,TRUNC((I8-34)/0.1,0)*0.04,(TRUNC((27-34)/0.1,0)*0.04)+(TRUNC((I8-27)/0.1,0)*0.06))) : -$2.98

    I8 is 26.6

    I have been trying to check what cause the difference and i think the truncate part is causing the inconsistency

    (TRUNC((27-34)/0.1,0)*0.04)+(TRUNC((-0.4)*10,0)*0.06) : -$3.04
    (TRUNC((27-34)/0.1,0)*0.04)+(TRUNC((26.6-27)*10,0)*0.06) : -$2.98

    Can experts here help me solve this mystery (at least a mystery for me) ?

  2. #2
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Truncating problem

    I made a quick spreadsheet, hopefully showing what you intend.

    I added columns G and H to verify the formula, and it would appear the formula is calculating correctly.

    The formula to calculate the total $ increase or decrease in in column F.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Rounding & Truncating
    By JaWindham in forum Excel General
    Replies: 1
    Last Post: 03-05-2015, 07:49 PM
  2. Truncating
    By lynnmc26 in forum Excel General
    Replies: 2
    Last Post: 10-20-2011, 04:13 PM
  3. Truncating, Trimming, or ???
    By abuchan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2010, 12:58 PM
  4. Delimiting without truncating
    By sirlink in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2009, 01:40 PM
  5. Preventing truncating
    By djarcadian in forum Excel General
    Replies: 1
    Last Post: 04-01-2009, 12:18 AM

Tags for this Thread

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