+ Reply to Thread
Results 1 to 6 of 6

Function to display certain number in cell

  1. #1
    Registered User
    Join Date
    09-23-2020
    Location
    FL
    MS-Off Ver
    2016
    Posts
    3

    Function to display certain number in cell

    Hello I’m trying to put together a price sheet for window sales and the prices are size dependent ie a window that is 70 inches is $950 dollars but so is a window that is 60 but a window that is 71 inches is $ 1150there is a threshold for price difference. So basically i need a function that states if e8 is = 0 then print zero in g8 if e8 is >=1 but <70 print 950 in g8 so on and so forth. sorry if this is confusing . I am not an excel master. I tried this but it wont work correctly

    =IF((E8)=0,0,IF(AND((E8)>1,(E8)<=70),950,IF(AND((E8)>70,(E8)<=89),50,1150))) this only prints 0 or 1150 but nothing else.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Function to display certain number in cell

    That looks like a lookup table + lookup function kind of problem (using the "approximate match" option in your chosen lookup function). Using VLOOKUP() (https://support.microsoft.com/en-us/...rs=en-us&ad=us ):

    1) Create your lookup table:
    Please Login or Register  to view this content.
    2) Enter your lookup function =VLOOKUP(size,absolute_reference_to_lookup_table,2,TRUE)

    Will something like that work for you?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    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: Function to display certain number in cell

    I think based on what you wrote that this is a simplification of what you want.
    =IF(E8=0,0,IF(E8<=70,950,IF(E8<=89,50,1150)))
    You don't need so many parentheses and in a multiple IF statement they read left to right so the first thing that solves the problem - such as 48 in E8, then it will return 950, if it is above that it will return 50, otherwise 1150.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    09-23-2020
    Location
    FL
    MS-Off Ver
    2016
    Posts
    3

    Re: Function to display certain number in cell

    This might work it would just need to always return 0 if 0 and always return 950 if between 1 and 70. Between 71 and 89 return 1150 and so on
    Last edited by Parkerm34; 09-25-2020 at 03:24 PM.

  5. #5
    Registered User
    Join Date
    09-23-2020
    Location
    FL
    MS-Off Ver
    2016
    Posts
    3

    Re: Function to display certain number in cell

    The 50 was a mistake. Basically if it is 0 it returns 0. If between 1 and 70 it prints 950. 71 to 89 it prints 1150 and so on.

  6. #6
    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: Function to display certain number in cell

    not sure if you adjusted it or not, but basically if the 50 was a mistake then just change it to this.
    =IF(E8=0,0,IF(E8<=70,950,IF(E8<=89,1150,"")))
    though I'm not sure what you mean by "and so on" if we are supposed to keep going up from there using our guesses for each increment?
    If you have more of them then as Mr Shorty noted in post #2, you might want to set up a table and use a vlookup for this.

+ 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. [SOLVED] date function or text function recommended? to display mmm-yy when year is cell A1
    By BigPapaMurf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-28-2020, 12:14 AM
  2. If a cell begins with a 5 display that number if not display nothing
    By tia814 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-02-2016, 07:09 AM
  3. Replies: 3
    Last Post: 06-30-2015, 10:28 AM
  4. [SOLVED] What function to use to display a # value if under or over a specific number?
    By kmfb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2013, 10:01 AM
  5. Replies: 1
    Last Post: 07-17-2012, 09:10 AM
  6. Replies: 4
    Last Post: 02-15-2010, 08:40 PM
  7. [SOLVED] I want to display the number 0 first in a cell, it won't let me n.
    By lauren in forum Excel General
    Replies: 4
    Last Post: 03-08-2005, 08:06 PM

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