+ Reply to Thread
Results 1 to 5 of 5

IF formula

  1. #1
    Registered User
    Join Date
    12-10-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    3

    IF formula

    Hi all

    I have a long list of rows (500.000 rows), based on two colums: 1) product codes 2) price

    Each line of product code (contains numbers and letters) has a price.

    I need to create a fomula in a third column (named 'new price') that creates a new price of all product codes that begins with the letters 'TELMO'. Those product codes that contain 'TELMO', shall have a new price: Price-100. After that, the same formula must also search for all product codes that begins with 'Basis', and create a new price to: price + 20.

    Does that make sense?

    Example:
    Product code Price New price
    Telmo10B 219 219-100
    Basis60G 0 0+20

    I now it's something with a If formula, probalby two if's in the same formula.

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    08-04-2011
    Location
    UK
    MS-Off Ver
    Excel 2021
    Posts
    346

    Re: IF formula

    try this

    =IF(LEFT(A2,5)="Telmo",B2&"-100",IF(LEFT(A2,5)="Basis",B2&"+20",""))

  3. #3
    Registered User
    Join Date
    12-10-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    3

    Re: IF formula

    I tried this formula, but something does not work. Please look at this attached screenshot of the worksheet. I need the new price in the AV column.
    Udklip.JPG

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF formula

    A spreadsheet upload (Go Advanced>Manage Attachments) is better than a picture.

    Assuming row 2
    adjusting Alan's formula

    =IF(LEFT(AC2,5)="Telmo",AD2-100,IF(LEFT(AC2,5)="Basis",AD2+20,AD2))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    12-10-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    3

    Re: IF formula

    That worked, thanks guys! Appreciated.

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04: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