+ Reply to Thread
Results 1 to 6 of 6

Check if cell contains a number in a given range of numbers

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    33

    Check if cell contains a number in a given range of numbers

    I'm trying to build out a formula to return a letter based on a tree of possible answers from different columns. I've attached an image of the table I'm trying to build the equation for. Basically if column A contains a 9 or a 10 and if column B contains 10, 9, or 8 and column C contains 10, 9, 8, ...1, then return an H, else, check back in column A and continue on. I'm not sure how to simplify the equation so I'm not doing a million IF(OR()) statements.
    Screenshot at May 26 14-12-38.png
    Last edited by smockpuv; 05-26-2022 at 04:20 PM.

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Check if cell contains a number in a given range of numbers

    is there any chance that you can create a mockup file that has some sample data that helpers can use to start building your formulas?
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  3. #3
    Registered User
    Join Date
    04-02-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Check if cell contains a number in a given range of numbers

    Not sure why it's not processing the equation, but this is what I've been doing as a workaround for now. A ton of if(or() statements.
    I think I've attached the file, let's see if this works.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Check if cell contains a number in a given range of numbers

    at the moment, the formula doesnt match what is displayed in the image, and there is not enough sample data with which to decipher what your conditions are.

    i suggest you write the list of conditions (not the formula), so that we can understand what result you are trying to achieve.

  5. #5
    Registered User
    Join Date
    04-02-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Check if cell contains a number in a given range of numbers

    If severity is a 9 or 10, and occurrence is 10, 9, or 8, and detection is 10, 9, 8, 7, 6, 5, 4, 3, 2, or 1 return "H". Else, if occurrence is 7 or 6, and detection is 10, 9, 8, 7, 6, 5, 4, 3, 2, or 1 return "H". Else, if occurrence is 5 or 4 and detection is 10, 9, 8, 7, 6, 5, 4, 3, or 2, return "H". Else, if detection is 1, return "M". Else, if occurrence is 3 or 2 and detection is 10, 9, 8, or 7 return "H". Else, if detection is 6 or 5 return "M". Else if detection is 4, 3, 2, or 1 return "L".

    So I'm essentially trying to build the logic that will automatically calculate the Action Priority (AP) column and assign a value of High (H), Medium (M), or Low (L) based on the values in the severity, occurrence and detection columns. Does that help or just complicate matters more?

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Check if cell contains a number in a given range of numbers

    As there appear to be more L's and M's than H's I would isolate the L and M conditions for those AP's and let everything else yield H as in:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Take a look at Sheet2 to see if all the results look correct.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Removing a number or a range of numbers from a numeric cell
    By khank in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-11-2015, 03:48 PM
  2. Check for Number in one column - then count specific numbers in a range.
    By CarlosM1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-29-2014, 05:10 AM
  3. Vba code to check a number in a cell against numbers in a column
    By Buddy8 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-07-2014, 03:33 PM
  4. [SOLVED] Output a specific number from range of numbers in one cell
    By Sigmaiota in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-18-2014, 01:03 AM
  5. [SOLVED] check if number in once cell exists in a range of cells and if yes, format another cell
    By beaujolais44 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2013, 07:23 AM
  6. Check range for number if found paste data into cell
    By Sal1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2011, 03:29 PM
  7. when typing to a cell check if this number exist in a range of cells (in sheet 2)
    By gtserkou in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-28-2008, 01:18 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