+ Reply to Thread
Results 1 to 3 of 3

IF Statement: How would I go about writing this

  1. #1
    Registered User
    Join Date
    12-02-2008
    Location
    Nashville
    Posts
    26

    IF Statement: How would I go about writing this

    I am wanting to write an if statement for the following data

    Oct Nov Dec
    SWB SWB SWB
    0 1 50
    0 0 100

    That says the first time there is data greater than 0 return the month cell.

    How would I go about writing this, I do not know the code for the if statement.


    Thanks

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    re: IF Statement: How would I go about writing this

    Do you mind uploading a sample workbook, with descriptions of your intended result. Mostly I am questioning "the first time there is data greater than 0 return the month cell". What do you mean by this? Do a Google search on VLookup and HLookup and let me know if either of these is close to the functionality you are looking for.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    re: IF Statement: How would I go about writing this

    Assuming headers are in A1:C1, and first row of data is in A2:C2, try:

    =INDEX($A$1:$C$1,MATCH(TRUE,INDEX($A2:$C2>0,0),0))

    copied down

    adjust ranges to suit.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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