+ Reply to Thread
Results 1 to 9 of 9

Need one large nested formula 7 diffent results

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Need one large nested formula 7 diffent results

    I'd like to make one formula to test for 7 different ranges of values in column A and assign a value of 1 - 7 in column B depending on the value in column A. For example if column A1 had a value of 235 B1 would get assigned a value of 4 because it is greater than 233 but less than or equal to 6,210.


    HTML Code: 

  2. #2
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Need one large nested formula 7 diffent results

    Don't be lazy! If you know how to use the IF function, it shouldn't be too difficult!

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Need one large nested formula 7 diffent results

    JET2011,

    Edited Re read.
    Put the values in an array constant descending. Use an approximate MATCH for the choices.
    Last edited by FlameRetired; 08-22-2017 at 05:34 PM.
    Dave

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Need one large nested formula 7 diffent results

    I've simplified the problem with whole numbers to make it easer for someone to hopefully to assist.

    HTML Code: 

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

    Re: Need one large nested formula 7 diffent results

    I will agree with Flame Retired -- rather than an IF() function, use a simple lookup function (MATCH() function specifically). Your values are sorted in descending order, so you will need to use -1 as the 3rd argument of the MATCH() function.
    Match function help file: https://support.office.com/en-us/art...9-533f4a37673a
    What part of using the MATCH() function do you get stuck on or don't understand?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Need one large nested formula 7 diffent results

    Never used it but I'll scout around for more examples. Most examples I found were way more complex. Will report back. - j

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

    Re: Need one large nested formula 7 diffent results

    Scout around for examples. I have noticed that the vast majority of examples of Excel's lookup functions are for exact matches (3rd argument of MATCH() function is 0) and very few examples illustrate the behavior of the approximate match options. In those cases, use the examples to get a basic idea of the syntax of the MATCH() function. Once you understand the syntax, you will probably need to try it out with the approximate -1 option in your own spreadsheet so you can see how the approximate match option works.

    If it helps, I created this tutorial that has an example (using VLOOKUP()) of this approximate match behavior: https://www.excelforum.com/tips-and-...p-example.html VLOOKUP() cannot work with descending data like the MATCH() function can, but it will hopefully help you see how it should work.

  8. #8
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Need one large nested formula 7 diffent results

    Put this code in a module. Then in excel, enter formula =GreaterOrLess(A2*). *Click on a cell

    Please Login or Register  to view this content.
    Last edited by Raphaelp; 08-24-2017 at 02:25 PM.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Need one large nested formula 7 diffent results

    JET2011 I failed to mention what I meant by array constant. (I also left out other details which MrShorty covered.)

    The references cited use some array constants. It doesn't appear they state that explicitly.

    In the original data an array constant descending in the second argument of MATCH would look like this.

    {308538,66807,6210,232,3.4,0.019,0}

    Hope that helps.

+ 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] Sumproduct Formula - Returning result in two diffent places for same entry?
    By SVTF in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-09-2015, 10:23 AM
  2. Replies: 2
    Last Post: 08-24-2014, 04:56 AM
  3. [SOLVED] ARRAY Formula matching LARGE, getting duplicated results
    By Ricardo Mass in forum Excel General
    Replies: 9
    Last Post: 03-10-2014, 09:04 AM
  4. Large nested if(and)
    By nicolelschramartin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2013, 04:42 PM
  5. Replies: 5
    Last Post: 09-03-2010, 05:05 PM
  6. Large formula not returning desired results
    By Climaxgp in forum Excel General
    Replies: 2
    Last Post: 04-21-2010, 06:05 AM
  7. [SOLVED] large formula question - Max nested functions
    By PCLIVE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2005, 12:05 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