简体   繁体   中英

Using Vlookup inside array formula in Sheets

I have two sheets with relevant columns:

  • Confirmed Cards
    • a. Email
    • b. Credits
  • Purchase Credits.
    • a. Email
    • b. Rolling Total Credits

I'm hoping to populate "Credits" inside of "Confirmed Cards" with "Rolling Total Credits" from "Purchase Credits" by cross-referencing emails to show how many credits a user has.

I'm hoping to do this within an Array Formula, so as users are added to my database within confirmed cards, the amount of credits they own are automatically updated.

This is what I am currently using within "Confirmed Cards" to try to pull in the amount of credits the user has:

=ArrayFormula(VLOOKUP(A2:A,'Purchase Credits'!A2:F,5))

The formula correctly inputs the correct amount of credits for A2, the first user email, however, it inputs this value into every single row, regardless of email. For example, if alex@gmail.com has 100 credits, this amount shows for every single row within "Credits."

you will need 4th vlookup parameter. try:

=ARRAYFORMULA(IFERROR(VLOOKUP(A2:A, 'Purchase Credits'!A2:F, 5, 0)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM