+ Reply to Thread
Results 1 to 9 of 9

IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

  1. #1
    Registered User
    Join Date
    09-08-2022
    Location
    Tokyo
    MS-Off Ver
    2010
    Posts
    7

    Post IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    I have a spreadsheet with one column (Column B) showing all the months' names (like this: Jan, Feb, Mar, etc.) based on the date input in a previous Column A. In other words: Column A has dates put in this format "03/14/01", the next Column B shows these months' name and is Custom formatted like this "mmm" and it is using this formula: =TEXT(A2,"mmm"), =TEXT(A3,"mmm"), =TEXT(A4,"mmm"), etc..
    The next Column C has some positives and some negatives numbers.
    Now, in the Column D, I would like to have the numeric results based on a month. Let's say for the month of January what number in Column C will correspond to, or what number in Column C will correspond to month of February, and what number in Column C will correspond to month of March, etc..
    Each month in Column A (or B) exists more than once.
    I have tried IF and then IF(AND, VLOOKUP but with no success.

    Can someone please help me with that problem.
    Thank you.
    Last edited by Pawko1; 10-11-2022 at 02:07 AM.

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

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    Could you attach sample sheet, or an image at least?
    Quang PT

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,189

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    If you want to COUNT or SUM then look at COUNTIF(S) or SUMIF(S) functions

    e.g SUMIF(B1:B100,"Jan",C1:C100)

    to extract monthly figures, you can use the INDEX/AGGREGATE functions

    As requested please post a file - NOT image.
    Last edited by JohnTopley; 10-11-2022 at 02:51 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    09-08-2022
    Location
    Tokyo
    MS-Off Ver
    2010
    Posts
    7

    Post Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    Hello!

    Thank you for the suggestions.
    In the attachment is a copy of that file and an explanation what I'm trying to get.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,189

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    in G6

    =IFERROR(IF(INDEX($C$2:$C$23,MATCH($F6,$A$2:$A$23,0))>0,INDEX($C$2:$C$23,MATCH($F6,$A$2:$A$23,0)),""),"")

    copy across to H

    copy dpwn

  6. #6
    Registered User
    Join Date
    09-08-2022
    Location
    Tokyo
    MS-Off Ver
    2010
    Posts
    7

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    To JohnTopley.
    Thank you so much, this is genius, however in the column H, I'm getting also positive values and not negatives.
    Can you please look in that?

    Thank you again.
    Last edited by Pawko1; 10-11-2022 at 01:43 PM.

  7. #7
    Registered User
    Join Date
    09-08-2022
    Location
    Tokyo
    MS-Off Ver
    2010
    Posts
    7

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    To JohnTopley.
    I have modified your formula a bit (to get negative numbers), but still some data is missing in the column H. See attachment.
    For example, there are TWO identical dates for March 3/12/22 and one of them has value positive 16, and other other negative -18. Since those two data has been taken
    very same day, but were taken at different times, looks like the problem is in there, isn't it?
    If so, how it should be modified? Modify the dates with exact time with minutes and seconds and then apply this formula again?
    Any suggestions?

    Thank you
    Attached Files Attached Files
    Last edited by Pawko1; 10-11-2022 at 01:55 PM.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,189

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    Try

    =IFERROR(INDEX($C$2:$C$23,AGGREGATE(15,6,ROW($A$1:$A$100)/($A$2:$A$23=$F6)/($C$2:$C$23>0),COUNTIF($F$2:$F6,$F6))),"")

    =IFERROR(INDEX($C$2:$C$23,AGGREGATE(15,6,ROW($A$1:$A$100)/($A$2:$A$23=$F6)/($C$2:$C$23<0),COUNTIF($F$2:$F6,$F6))),"")

  9. #9
    Registered User
    Join Date
    09-08-2022
    Location
    Tokyo
    MS-Off Ver
    2010
    Posts
    7

    Re: IF...AND...VLOOKUP?? I'm not sure. Can someone please help me!

    To JohnTopley....It looks very promising and it should do the task.
    Thank you so much again for your help!

+ 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: 5
    Last Post: 12-07-2016, 09:18 AM
  2. Replies: 3
    Last Post: 12-04-2014, 01:27 PM
  3. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  4. 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
  5. how to bring all vlookup returns even with duplicate vlookup search keys
    By NYC4LIFE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-06-2013, 04:53 PM
  6. 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
  7. 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