+ Reply to Thread
Results 1 to 22 of 22

Vlookup formula with multi column

  1. #1
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Vlookup formula with multi column

    Hi dear,
    hank you so much for your Help,
    you are great and they are very valuable,
    but I have a problem with the above case and can not solve it I ask for help,
    From book 1 Column B. based on the date, the data from column C,I,O to transferred automatically to book 2 in column C with vlookup ore other method,
    thank uoy do much,
    Attached my book
    Attached Files Attached Files

  2. #2
    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,258

    Re: Vlookup formula with multi column

    Try

    =SUMPRODUCT(('Book-1'!$B$3:$N$3="Date")*('Book-1'!$B$5:$N$35=B3)*('Book-1'!$C$5:$O$35))
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    Nice solution John, better than what I had. It can be just SUM instead of SUMPRODUCT though.

    @toni I notice that 30/03/21 is repeated in Book-1, the second one is presumably meant to be 31/03/21.

  4. #4
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    Hello,
    thank you very much john, your formula has helped me a lot, in the easy solution of the problem.
    with respect.

  5. #5
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    Quote Originally Posted by JohnTopley View Post
    Try

    =SUMPRODUCT(('Book-1'!$B$3:$N$3="Date")*('Book-1'!$B$5:$N$35=B3)*('Book-1'!$C$5:$O$35))
    Hi john,
    I have a problem with your formula , because you they not counting other months than these three months,
    I ask you to help me more concretely how I can formulate it for other rates as well.
    Last edited by toni.1; 03-28-2022 at 02:48 PM. Reason: correction of formual.

  6. #6
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    If you have the same format for the year (i.e. each month uses 6 columns in the same order), you could try something like:

    =INDEX('Book-1'!$C$5:$BT$35,MATCH(DAY(B3),DAY('Book-1'!$B$5:$B$35),0),COLUMN(INDEX($1:$1,1+6*(MONTH(B3)-1))))

  7. #7
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    my friend,
    Wrong formula,
    pls, open attach file,ore
    you can check jonh posts in march 17 in attach file i have the example ,
    Attached Files Attached Files
    Last edited by toni.1; 03-28-2022 at 03:06 PM. Reason: correction,

  8. #8
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Vlookup formula with multi column

    Hi to all!

    Another option could be:
    PHP Code: 
    =SUMIF('Book-1'!B$5:N$35,B3,'Book-1'!C$5:O$35
    Blessings!

  9. #9
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    Well, it worked for me

    John's should work if you extend the ranges? e.g. change $N to $BP and $O to $BQ

    Edit - just seen your new attachment. Are you wedded to having that layour of months? It would be a lot easier if they were all in a line.

  10. #10
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    thannk john
    still does not work because I have other tree same tables below, for months to come and it does not work!
    you cak open attached files to know the problem.
    Attached Files Attached Files
    Last edited by toni.1; 03-28-2022 at 03:27 PM. Reason: still nor working

  11. #11
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Vlookup formula with multi column

    toni.1 ... just extend ranges to your next months with the same logic. If you understand the logic, you can replicate the formula. Try it! Blessings!

  12. #12
    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,258

    Re: Vlookup formula with multi column

    Try

    =SUMPRODUCT(('Book-1'!$B$3:$N$3="Date")*('Book-1'!$B$5:$N$141=B3),('Book-1'!$C$5:$O$141))

    BUT ensure you change month dates as you simply copied/pasted the first 3 months.

  13. #13
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    I came up with this:

    =INDEX('Book-1'!$A$5:$R$140,MATCH(DAY(B3),DAY('Book-1'!$B$5:$B$35),0)+35*INT((MONTH(B3)-1)/3),COLUMN(INDEX($1:$1,MOD(3+6*(MONTH(B3)-1),18))))

    But John Vergara's solution is nicer. Just extend range. (it doesn't work on your example sheet because you have repeated the dates)

    Edit - fixed formula.
    Last edited by nick.williams; 03-28-2022 at 04:19 PM.

  14. #14
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    not correct sum,
    i correct all date but still to give othe vrong sum ,
    pls can you check now,with correction month ,
    Attached Files Attached Files

  15. #15
    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,258

    Re: Vlookup formula with multi column

    The SUMPRODUCT returns all the correct data!!!
    Attached Files Attached Files

  16. #16
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    toni, the dates are still wrong in some places. e.g. 1st October appears twice, once in the correct place and again at the end of September.

  17. #17
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    Nick.Williams,

    the problem is because the formula calculate wrong columns not dates,
    instead of leaving the column the sum is leaving the total column.
    if the date paste in other table formula not working, for example in 1 april not work,
    Attached Files Attached Files

  18. #18
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    If you are referring to my formula, the latest one does not work, it looks like I didn't paste the final version, sorry. I will edit my post. The working version is:

    =INDEX('Book-1'!$A$5:$R$140,MATCH(DAY(B3),DAY('Book-1'!$B$5:$B$35),0)+35*INT((MONTH(B3)-1)/3),COLUMN(INDEX($1:$1,MOD(3+6*(MONTH(B3)-1),18))))

    But also JohnTopley and John Vergara's work. Please tell me which one is giving the wrong answer.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    dear my friends,
    all of the options are wrong you can check,
    if the column of date is blank your formula the are give the sum, only john vergara no,
    but if the date is for example 01.01.2020 one year leter the option of john vergara give the wrong sum!
    i cant solve the problem because my table some time must be blank or must be holidays.
    thanks for you,

  20. #20
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Vlookup formula with multi column

    Well to be fair you didn't mention that you wanted to deal with dates outside your lookup range...and you still haven't siad what you want as a result. I guess to return blank? Or 0?

    It's not difficult to provide a solution, once we know the problem. For example mine can be tweaked to be:

    =IFERROR(IF(YEAR(B3)=2022,INDEX('Book-1'!$A$5:$R$140,MATCH(DAY(B3),DAY('Book-1'!$B$5:$B$35),0)+35*INT((MONTH(B3)-1)/3),COLUMN(INDEX($1:$1,MOD(3+6*(MONTH(B3)-1),18)))),""),"")

    Change the ""),"") at the end to 0),0) if you want it to be 0 rather than blank.

    I'm sure you can make similar alterations to the other options.

  21. #21
    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,258

    Re: Vlookup formula with multi column

    Why dates of 1900 ,2018 and 2023 ? Of course the formula will never match against Book 1; I have absolutely no idea what your are doing so I am not wasting any more time on this.

  22. #22
    Registered User
    Join Date
    03-17-2022
    Location
    Europe, Albania
    MS-Off Ver
    Microsoft Office 2010
    Posts
    11

    Re: Vlookup formula with multi column

    My friend,
    I really want, the data in book 1 specifically in Columns: C, I, O to be transferred to book 2 in column C based on the date of columns B in both books,

    Blessings!

+ 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. Need formula for multi conditional vlookup
    By powerseller1001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2020, 09:58 AM
  2. Multi-variable vlookup formula
    By brefed15 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2019, 12:32 PM
  3. How to do multi-column vlookup using multiple workbooks?
    By 0Cool in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-18-2019, 06:42 AM
  4. Replies: 4
    Last Post: 11-23-2017, 09:47 PM
  5. [SOLVED] Vlookup for multi column
    By Karnik in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2013, 03:43 AM
  6. Multi column VLOOKUP?
    By huggie_1980 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2013, 01:46 PM
  7. Multi-column Matching For Unordered Vlookup
    By bernborough in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2010, 03:39 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