+ Reply to Thread
Results 1 to 14 of 14

Indentfying a number between field

  1. #1
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Indentfying a number between field

    Hi all,

    I need a formula that looks at a section id say UW2022 in one field and a number which represents that say in another field next to it 300. Then i want it to look at another table lookup which says UW2022 in one field and next fields on that line the values between that section id say field 1 100 and field 2 400. So it would then return it as a true statement that 300 was between that range for UW2022 100-400

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,404

    Re: Indentfying a number between field

    Welcome to the forum.

    Excel 2008??? Really?

    You will need VLOOKUP with the approximate match flag.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: Indentfying a number between field

    Sorry 2010 lol, see attached example spreadsheet

    Thanks hope you can help me
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,404

    Re: Indentfying a number between field

    The data is completely different ... Wrong workbook???

    Look, if you want help, you need to get this right. I am afraid I do not have either infinite amounts of time or patience.

  5. #5
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: Indentfying a number between field

    Sorry what I wan it to do is take for example the first line A34/B/01 200 300. I want to look at that section on the raw data then identify which rows these will be 45-62 and then put an S next to them from the slight field on the Lookup table.

    I am taking this cant be done then

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,404

    Re: Indentfying a number between field

    Of course it can, but there are still issues with your sample data.

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    1
    SECTION_CO Start Value Range End Value Range Slight
    2
    A34/B/01
    200
    300
    S
    3
    A34/B/01
    400
    422
    S
    4
    A34/D/01
    0
    100
    S
    5
    A34/D/01
    400
    500
    S
    6
    A34/D/01
    500
    600
    S
    7
    A34/D/01
    800
    900
    S
    Sheet: Lookup

    Why is there a missing section for the second code? 600-800???

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,412

    Re: Indentfying a number between field

    Try:
    Please Login or Register  to view this content.
    With COUNTIFS is counting how many rows those fit the 3 criterias
    Quang PT

  8. #8
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: Indentfying a number between field

    Quote Originally Posted by bebo021999 View Post
    Try:
    Please Login or Register  to view this content.
    With COUNTIFS is counting how many rows those fit the 3 criterias
    That works but it saying every line is S. It first start to kick in at rows 45-62 as that is the first line of the look which has the values between 200 -300 then it should kick in again the values are between 400 -422

  9. #9
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: Indentfying a number between field

    Quote Originally Posted by AliGW View Post
    Why is there a missing section for the second code? 600-800???
    Because there is not a s occurance between 600-800 so it would come back as n/a on the raw data sheet where there is a number range between 600-800
    Last edited by AliGW; 06-30-2020 at 03:33 AM.

  10. #10
    Forum Contributor
    Join Date
    03-17-2010
    Location
    karachi
    MS-Off Ver
    Excel 2003
    Posts
    113

    Re: Indentfying a number between field

    try this =IF(AND(A2:A2=A2,B2:B2>=200,C2:C2<=300),"s","")

  11. #11
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: Indentfying a number between field

    Quote Originally Posted by sohaila View Post
    try this =IF(AND(A2:A2=A2,B2:B2>=200,C2:C2<=300),"s","")
    That works and picks up the first line of the lookup which is shown further up but then identifies every number value between 200-300. The next should be 400- 422 and the next should be a new section id A34/D/01 0-100. Basically it should look at the section id to the two values in the lookup then it should but a" s" between those numbers value within that range

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,412

    Re: Indentfying a number between field

    How about this in D2:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    06-30-2020
    Location
    UK
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: Indentfying a number between field

    Quote Originally Posted by bebo021999 View Post
    How about this in D2:
    Please Login or Register  to view this content.
    Right that works which is brill however the lookup will be a long list of different Section ID currently it is only picking those in the example I sent. What do we need to tweak so it expands the search for the full lookup list and does the same process and identifies the between values and adds an s next them. I really appreciate your time and will save me a load of hours manually doing this

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

    Re: Indentfying a number between field

    You would need to change the row number of the range from 7 to whatever is the largest row in the full lookup list.
    For example if the actual lookup list has 50 rows, including the column headers, then the formula could be modified to read:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If the lookup list is dynamic then convert it to a table and the formula will change as rows are added.
    Let us know if you have any questions.
    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. decimal field of a number is changing when I strip off the integer field.
    By whburling in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2017, 12:33 PM
  2. Determine number of row field items under given data field
    By enphynity in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 02-13-2015, 03:30 PM
  3. Replies: 6
    Last Post: 12-07-2014, 06:59 PM
  4. Hidden field with text, number, to show there is something in field
    By Bilal93 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-09-2014, 10:50 AM
  5. Replies: 2
    Last Post: 07-15-2012, 04:05 PM
  6. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  7. Replies: 3
    Last Post: 02-12-2009, 01:08 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