+ Reply to Thread
Results 1 to 5 of 5

Cell Address of First Negative Number in a Column

  1. #1
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Cell Address of First Negative Number in a Column

    Hello, I am trying to get the address of the first occurance of a negative number in a single column.

    So far I have been able to find the value using the below forumla, but I want to the CELL of the value. TIA!

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,720

    Re: Cell Address of First Negative Number in a Column

    Assuming your data is in column A, then here is a VBA solution.

    Please Login or Register  to view this content.

    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
    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
    Registered User
    Join Date
    11-18-2015
    Location
    qatar
    MS-Off Ver
    2010
    Posts
    61

    Re: Cell Address of First Negative Number in a Column

    Hi
    Try...
    Please Login or Register  to view this content.
    Array Formulas
    Press CTRL-SHIFT-Enter ( press the CTRL and SHIFT keys, and while these are pressed down, press the Enter key.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Cell Address of First Negative Number in a Column

    Or...

    =ADDRESS(SMALL(IF(D:D<0,ROW(D:D),""),1),1)

    entered as an array. However, you might be better to avoid whole column references as this might slow your formula down.

    Just noticed the reply immediately above. Same approach taken by me... So here's a normal formula to do the same thing:

    =ADDRESS(SMALL(INDEX(((D:D>=0))*10^10+ROW(D:D),0),1),1)
    Last edited by Glenn Kennedy; 07-29-2016 at 03:52 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,729

    Re: Cell Address of First Negative Number in a Column

    Another way also array entered.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

+ 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] Find first negative number in column, return row number
    By slade8200 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2014, 11:14 AM
  2. Carrying Over Negative number to next column as a positive number
    By Redraven in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-21-2014, 06:39 AM
  3. Replies: 3
    Last Post: 08-07-2013, 11:29 AM
  4. Replies: 2
    Last Post: 12-19-2012, 08:12 PM
  5. [SOLVED] HOW TO FIND THE COLUMN OR ROW NUMBER of a address stored in a cell
    By chrismonica in forum Excel General
    Replies: 3
    Last Post: 07-07-2012, 10:43 AM
  6. Find out the Row and Column address number of the searched cell (separately)
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-05-2011, 09:32 PM
  7. Lookup largest number in a column treating negative number as postive number
    By xWiZardx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 08:09 AM

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