+ Reply to Thread
Results 1 to 16 of 16

1st occurance of value identification

  1. #1
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    1st occurance of value identification

    Is there a formula that identifies the first occurrence of a value that is either: A) <-499 or B) >499 in both columns a & b?

    example 1

    -----a-----------b
    1--"120"-------"120"
    2--"250"-------"250"
    3-"-100"------"375"
    4-"-250"------"500"
    5-"-650"------"600"
    6
    7-"500"

    example 2

    -----a-----------b
    1--"120"-------"120"
    2--"250"-------"250"
    3-"-100"------"375"
    4-"-250"-------"0"
    5-"-650"------"-300"
    6
    7-"-650"

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: 1st occurance of value identification

    Is this what you had in mind?
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    I'm looking for the first number that occurs given a parameter (<-499 or >499) from A:1 to B:5 to be listed in A:7.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: 1st occurance of value identification

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    Wow, that is way out of my league. I tried copy and pasting that into my spreadsheet, but nothing happened.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: 1st occurance of value identification

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button

  7. #7
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    I completed the install steps just fine, but when I select the macro and press "Run" nothing happens.

  8. #8
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    Oh, sorry! I'm such a space case. What I gave you was for example purposes only. Also, would it help if narrowed from two columns to one? So....

    Looking for the first occurrence of a value that is either: A) <-499 or B) >499 in:

    O2:O163, and the answer to appear in cell O168

    R2:R163, and the answer to appear in cell R168

    V2:V163, and the answer to appear in cell V168

    Y2:Y163, and the answer to appear in cell Y168

    AC2:AC163, and the answer to appear in cell AC168

    AF2:AF163, and the answer to appear in cell AF168

    AJ2:AJ163, and the answer to appear in cell AJ168

    AM2:AM163, and the answer to appear in cell AM168

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

    Re: 1st occurance of value identification

    May be try this:
    Please Login or Register  to view this content.
    Quang PT

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

    Re: 1st occurance of value identification

    For last info from you:
    In O168:
    Please Login or Register  to view this content.
    Copy to R168,...

  11. #11
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    bebo, that works GREAT! Thanks a lot.

    If you don't mind do you think you could alter that formula to do the same thing but in just column "O"? Also, if there is no value that meets the criteria do you know how to make the 168 value to reflect the value in O:163? Thanks again!

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

    Re: 1st occurance of value identification

    Not clear your mind at all,
    You mean to find the first value that match either >499 or <-499 in only one column?
    And what does the "make the 168 value to reflect the value in O:163" mean?

  13. #13
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    Yes, I mean to find the first value that matches either >499 or <-499 in just column "O".


    Let's say that there are NO values that meet the criteria (>499 or <-499) in O2 to O163, is there a way to get the formula in O:168 to show the value that is in O163 if that is the case?

    Example:

    -----O
    1--"120"
    2--"250"
    3-"-100"
    4-"-250"
    5-"450"
    .
    .
    .
    .
    163-"-200"
    .
    .
    .
    168-"-200"

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

    Re: 1st occurance of value identification

    Try this array formula:
    Please Login or Register  to view this content.
    Confirmed with Ctrl-shift-enter

  15. #15
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    It works perfectly!

  16. #16
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: 1st occurance of value identification

    bebo, just ONE more question:

    Could you give me the formula I would use if I wanted to switch the min/max values from +/-499 to min -399 and max 599?

+ 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. color identification
    By kooty in forum Excel General
    Replies: 1
    Last Post: 10-02-2012, 08:27 AM
  2. Identification and use of a particular box
    By Gawel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2012, 06:52 AM
  3. Object Identification
    By JSMITHXX in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2012, 07:36 AM
  4. Month Identification
    By jkelly228 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-03-2011, 11:40 AM
  5. [SOLVED] Keystroke identification
    By Tim in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2006, 06:35 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