+ Reply to Thread
Results 1 to 9 of 9

If or Vlookup? need help please

  1. #1
    Registered User
    Join Date
    07-11-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    15

    Post If or Vlookup? need help please

    Currently I am working with my data collection on my master thesis and I am trying to figure out which formula to use in order to gather together the information from two different sheets on Excel.

    For example

    Sheet 1: I have stock with the code nr of "8135" and daily stock return for this stock between 21/10/2013 and 20/02/2014


    Sheet 2: I have announcements made by different companies between the time interval of 24/10/2013 and 14/02/2014


    What I wan to achive is whether I can create a formula which finds that "If the "stock code" in sheet 1 is equal to the "stock code" on sheet 2 AND if the date on sheet 2 is equal to the date on sheet 2 THEN write Announcement or else nothing.


    Maybe the picture below illustrates the example better, the red "announcement" columns is what i want to achieve.


    http://s15.postimg.org/3u5qc2ih7/if_or_vlookup.jpg




    Please let me know if it is achieveable an if so how or if you need further information.


    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: If or Vlookup? need help please

    What's wrong with the "=IF(AND" function shown in the screen shot?

  3. #3
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: If or Vlookup? need help please

    Hi,

    Welcome to the forum

    Try this formula...
    In cell F13, paste the formula below.
    IMPORTANT: Confirm the formula by pressing CTRL+SHIFT+ENTER. (This is an array based formula)
    Autofill the formula down the F column

    Formula: =IF(SUM(($J$8:$J$26=$D$7)*($L$8:$L$26=D13)*1)=1,"ANNOUNCEMENT","")
    Regards,
    Rudi

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: If or Vlookup? need help please

    Welcome to the forum.

    We generally prefer that you post the spreadsheet rather than a picture of it. That way it's easy to directly add & test suggestions - and a tested solution inside your spreadsheet can be posted back for you.

    That being said, I think this will do the trick for you:
    Please Login or Register  to view this content.
    copy into cell F13 & pull down to fill F13:F47


    EDIT:
    Quote Originally Posted by hoyasaxa215 View Post
    What's wrong with the "=IF(AND" function shown in the screen shot?
    It's close to being correct for a certain type of array formula, but it's doing tests on different-sized ranges (which would throw an error if entered) and it's not set up to return anything but the results for the very first row of cells.

    So RudiS' suggestions - changing the range assessment and nesting a SUM - would solve each of those issues in turn (although I wonder if it's possible to return SUM()>1, which might be an error...)?

    Well, array formulas are resource-intensive (they eat lots of computing power), so I went with the faster COUNTIFS instead, basically as a matter of personal preference.
    Last edited by ben_hensel; 07-11-2014 at 02:24 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: If or Vlookup? need help please

    Hey Ben,

    I agree with your assessment re array formulas. I try and avoid them unless they are absolutely needed.
    Your solution is much better

    Cheers

  6. #6
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: If or Vlookup? need help please

    As for me, I was halfway through the syntax of a SUMPRODUCT(--)>0 solution when I realized that a COUNTIFS was even better... because the OP had an almost-complete array solution, I started looking for an array answer, realized I could do it with SUMPRODUCT, then saw COUNTIFS could do it.

    It wasn't the most straightforward path-to-solution I've ever walked.

  7. #7
    Registered User
    Join Date
    07-11-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    15

    Re: If or Vlookup? need help please

    Thank you so much guys, I really appreciate your quick and good response. Compared to your knowledge about excel mine should be considered at the nursery level =/

    I have tried to insert your solutions but either the formula gives a wrong error or i get "#N/A" sign.

    Being new I really do not know how to upload a file on this forum but I uploaded the example file on: http://www.filedropper.com/example_2

    Hope you guys can help me!

    best regards
    Hewe

  8. #8
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: If or Vlookup? need help please

    Hi,

    Here it is.

    I used Ben's formula as it is more optimal than the array formula I posted...
    Cheers Ben!

    BTW: To upload a file, click on the "Go Advanced" button on the bottom of the window and use the paper clip button on the advanced windw toolbar...
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-11-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    15

    Re: If or Vlookup? need help please

    God bless you all, I have been trying to solve this for 3 days!! you guys really made my day.. ahhhh I love you and I will always hang around here to learn more!!

    Thank you so much and have a great weekend!!

    Best regards
    Hewe

  10. #10
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: If or Vlookup? need help please

    Quote Originally Posted by itshewe View Post
    I have tried to insert your solutions but either the formula gives a wrong error or i get "#N/A" sign.
    You need to adjust the syntax because what you've got in your spreadsheet is laid out differently than the sample picture.

    For example:
    Please Login or Register  to view this content.
    In D8 and pull down.

    This worked exactly as it was supposed to... based on my understanding of your needs, at any rate.

    BTW, the company for stock code 8135 is "ZMFY AUTOMOBILE" on sheet1 and "ZMFY Glass" on sheet2.

    Being new I really do not know how to upload a file on this forum...
    Click "Go Advanced" button (or Alt+X)
    Additional Options: Attachments: "Manage Attachments" button
    Navigate folders & select file(s)
    Click attach



    EDIT:
    ah, ninja'd

+ 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. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  2. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  3. [SOLVED] Vlookup is not working and giving =vlookup(B2,$T$2:$U$135,2,false) this kind of values.
    By yogeshsharma1981 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2013, 04:08 PM
  4. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  5. Replies: 5
    Last Post: 07-29-2009, 07:53 AM

Tags for this Thread

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