+ Reply to Thread
Results 1 to 4 of 4

Transform If Code to Formula

Hybrid View

fron Transform If Code to Formula 04-23-2007, 10:32 PM
Paul Can you post a copy of your... 04-23-2007, 10:39 PM
fron Services = col "U" market... 04-23-2007, 10:46 PM
mudraker Please read forum rules - see... 04-23-2007, 10:49 PM
  1. #1
    Registered User
    Join Date
    03-22-2007
    Location
    Malaysia
    Posts
    21

    Transform If Code to Formula

    if value in Column "N"<0 then
    cost avoidance = 0

    if value in Column "U" = "Services" then
    A = market price USD - Line Amount USD
    if A < 0 then
    A = List Price - Line Amount USD
    end if

    if A still < 0 then
    replace all -ve value = 0
    end if

    else if value in Column "U" <> "Services" then
    A = (market price - unit price)*Qty
    if A < 0 then
    A = (list price - unit price)*Qty
    end if

    if A still < 0 then
    replace all -ve value = 0
    end if

    I would like to transform this code to an IF formula instead of looping. This code is going to place only in one cell. Anyone can help me for this thing?

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Can you post a copy of your spreadsheet? Otherwise, update your original post with additional data, including:

    What cells/columns are referenced by cost avoidance, market price, line amount, list price, unit price, etc.. And what does 'replace all -ve values' mean??

    A nested IF statement may be possible, but you're testing a bunch of things that don't seem related in my mind. Seeing it would probably help.

  3. #3
    Registered User
    Join Date
    03-22-2007
    Location
    Malaysia
    Posts
    21
    Services = col "U"
    market price = col "AL"
    list price = col "AM"
    list amount = col "AN"

    if at the end, there is still negative value in cells, it will replace with "0".

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Please read forum rules - see blue link below & post you question in the correct forum

    Closing thread
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

+ 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