+ Reply to Thread
Results 1 to 4 of 4

Prevent calculation if value is 0

  1. #1
    Registered User
    Join Date
    10-16-2018
    Location
    Newcastle
    MS-Off Ver
    Office 365
    Posts
    2

    Prevent calculation if value is 0

    Hi there,

    Hoping someone out there can help!

    I am calculating profit and loss of products by v-looking up the units made from a database then * this by sales price and - by production costs.

    However, if the units are 0 it's going into - figures to say we have lost money. I just want to add something to the forumla that stops the calculation if the v-lookup qty is 0

    =(VLOOKUP($A2,PRODUCTION!$A:B,2,0)*'Price List'!$B$2)-'Price List'!$C$2

    Can anyone help? I'm guessing it's an IF statement but unsure where and how to add it in.

    Thanks
    Rich

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Prevent calculation if value is 0

    Try something like this... =IF(VLOOKUP($A2,PRODUCTION!$A:B,2,0)*'Price List'!$B$2)-'Price List'!$C$2=0,"",(VLOOKUP($A2,PRODUCTION!$A:B,2,0)*'Price List'!$B$2)-'Price List'!$C$2)
    untested but make it something like that.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Prevent calculation if value is 0

    =IF(VLOOKUP($A2,PRODUCTION!$A:B,2,0)=0,"",VLOOKUP($A2,PRODUCTION!$A:B,2,0)*'Price List'!$B$2-'Price List'!$C$2)

  4. #4
    Registered User
    Join Date
    10-16-2018
    Location
    Newcastle
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Prevent calculation if value is 0

    Think that has worked. Life saver! Thank you so much

+ 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. Prevent auto calculation when opening a workbook for the first time
    By litmol in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-23-2019, 01:02 PM
  2. to prevent UDF calculation Range is empty
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2018, 11:42 AM
  3. Prevent Auto Calculation On Opening a Workbook
    By Excel-Access in forum Excel General
    Replies: 1
    Last Post: 09-30-2015, 08:05 AM
  4. Prevent calculation from changing
    By thmehr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2012, 09:33 AM
  5. Replies: 0
    Last Post: 12-07-2010, 10:22 AM
  6. [SOLVED] Howto prevent automatic calculation when open a CSV file
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2005, 12:05 PM
  7. Prevent calculation
    By Pat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2005, 01:06 PM

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