+ Reply to Thread
Results 1 to 5 of 5

Formula that changes answer cell based on numeric value in reference cell

  1. #1
    Registered User
    Join Date
    08-28-2014
    Location
    Houston, TX
    MS-Off Ver
    2007
    Posts
    3

    Formula that changes answer cell based on numeric value in reference cell

    Hey all,

    I'm not the most experienced with excel, but have been elected the office "computer guy". I'm trying to create a worksheet where we plug in three numbers and everything else is handled by formulas for calculating pricing on a product we make in our office.

    I am running into trouble when I have D8 reference C8 for a numeric value, then show the proper price based off of a scale (eg. 1-99 = $.16, 100-999 = $.14, 1000-3999 = $.12 etc.) Where C8's number decides the price shown in D8.

    I'm doing something similar in H8 based off of the numbers in A8 and B8 as well, but that may take us a while longer to come up with.

    I've really only used =sum type formulas before, and I feel like an =if formula would work, but I'm having trouble writing one with multiple answers.

    Thanks for the help in advance!

    Tinman
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Formula that changes answer cell based on numeric value in reference cell

    Try this nested IF function,

    =IF(C8<=99,M2,IF(C8<=999,M3,IF(C8<=3999,M4,IF(C8<=7999,M5,M6))))

    Let me break it down so you can see what's happening there;


    The IF function works as follows: (also this is the color code I'm using for the rest of this post)
    =IF(logical_test,value_if_true,value_if_false)

    Logical Test = Any test that returns a TRUE or FALSE value.

    So =if(100>50,"true","false")
    Since 100 is greater than 50, excel views that formula as
    =if(TRUE,"true","false")
    Since it is a TRUE, the Value_if_true option is selected

    Nesting them as I have above is:

    If the value is Less than or Equal to 99, use the value in M2 which is .16
    if it is NOT less than or equal to 99, it comes back as FALSE and the value_if_false section is selected, which is another test that states that the value is less than or equal to 999, if true it will return a $.12. If false, it goes to the next if, and so on.

    If none of them are true, it will return the .06 value, because there is no upper limit on that bracket I don't have to put another IF, because if all of the previous tests are FALSE, the only possible reason is that the number is greater than 7999, which would be 8000+


    Hope this helps!
    Last edited by Speshul; 08-28-2014 at 12:29 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  3. #3
    Registered User
    Join Date
    08-28-2014
    Location
    Houston, TX
    MS-Off Ver
    2007
    Posts
    3

    Re: Formula that changes answer cell based on numeric value in reference cell

    It worked! I appreciate the help!

  4. #4
    Registered User
    Join Date
    08-28-2014
    Location
    Houston, TX
    MS-Off Ver
    2007
    Posts
    3

    Re: Formula that changes answer cell based on numeric value in reference cell

    Makes sense now that I've seen it broken down like that! My brain doesn't work in a very linear way so stuff like this can get me bogged down really quick!

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Formula that changes answer cell based on numeric value in reference cell

    Don't worry, once an IF/AND/OR statement gets nested a enough times, it can confuse pretty much anyone

    Case and point: http://www.excelforum.com/the-water-...mula-ever.html
    Last edited by Speshul; 08-28-2014 at 01:02 PM.

+ 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] I need to add to a cell based on the specific answer in another cell
    By mikerules in forum Excel General
    Replies: 1
    Last Post: 04-26-2014, 01:33 AM
  2. [SOLVED] Using a numeric cell input to reference a matching cell in a table.
    By wytske in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-30-2012, 12:18 AM
  3. sum formula giving a cell reference in the answer
    By stanadon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2012, 06:29 AM
  4. Dynamic cell contents based on an other numeric cell value.
    By lapator in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2009, 02:30 PM
  5. [SOLVED] Cell Formula reference to cell Based On third Cell Content
    By Gabriel in forum Excel General
    Replies: 0
    Last Post: 02-11-2005, 02:06 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