I want to use vlookup to pull data from 1 sheet to another, but it isn't working, & I don't know why
Sheet one houses invoices. Sheet two houses statements. I want to be able to pull invoice numbers from sheet in three different rows into one statement row in sheet two. So, one cell in a row in sheet two under a column titled "Invoice Number" would contain 3 or 4 invoice numbers pulled from sheet one. My formula always comes up unparseable. Why?
Best Answer
-
Genevieve P. Employee AdminNo problem! Here are some videos and resources that may be more helpful, as they'll have visuals to go along with creating formulas:
- Article:Create and Edit Formulas in Smartsheet
- Article:Formulas: Reference Data from Other Sheets
- Webinar:Formulas webinar series
- Webinar:Smartsheet Formula Best Practices
Cheers,
Genevieve
Answers
-
Can you share your formula and screenshots of your 2 sheets, with any sensitive data removed?
-
Intern98 ✭✭✭=vlookup( invoice[email protected], *reference other sheet* select table of choice, column number, true)
-
teb ✭✭I don't have separate tables in my Smartsheet. So, a formula using a table will not work.
-
Genevieve P. Employee AdminHi@teb
It sounds like you actually want a JOIN(COLLECT formula instead of an Index(Match or Vlookup which will only bring back one matching value.
Try something like this:
=JOIN(COLLECT({Column to Return multiple data}, {Column with Matching Values}, [Matching Value]@row), ", ")
Cheers,
Genevieve
-
teb ✭✭Ok. Can I pull data from multiple columns and/or multiple rows using that formula?
-
Genevieve P. Employee AdminHi@teb
This can bring back multiple values fromonecolumn based on a matching value in a different column.
If you have multiple columns to look into, you can use + to add together formulas:
=JOIN(COLLECT({Column 1to Return multiple data}, {Column with Matching Values}, [Matching Value]@row), ", ") +JOIN(COLLECT({Column 2to Return multiple data}, {Column with Matching Values}, [Matching Value]@row), ", ")
Let me know if that makes sense! If this isn't working for you, it would be helpful to see screen captures of both sheets, identifying what it is you want to bring across with an example, but please block out sensitive data.
Cheers,
Genevieve
-
teb ✭✭@Genevieve P.Ok. Will it work with multiple rows? Thank you for helping me understand the limits of the formula.
-
Genevieve P. Employee AdminHi@teb
When you select the first range:
=JOIN(COLLECT({Column to Return multiple data},
this {column to return} is the entire column in your other sheet. This includes every cell down the entire sheet for this column, so multiple rows.
然后确保当你select the second range:
{Column with Matching Values}
You select the entire column as well. What the formula does is it first finds the matching value in this second column, like a filter. It finds all of the matching values (eg. row 3, row 25, row 102), then it brings back the cell value from thefirstcolumn you listed for those rows (row 3, row 25, row 102) ignoring all the other rows. Does that make sense?
-
teb ✭✭Hello@Genevieve P.
Thank you. It kind of makes sense. I am still learning. I will play with this and see what happens.
I appreciate your assistance!
-
Genevieve P. Employee AdminNo problem! Here are some videos and resources that may be more helpful, as they'll have visuals to go along with creating formulas:
- Article:Create and Edit Formulas in Smartsheet
- Article:Formulas: Reference Data from Other Sheets
- Webinar:Formulas webinar series
- Webinar:Smartsheet Formula Best Practices
Cheers,
Genevieve
-
teb ✭✭@Genevieve P.thank you for the resources! Awesome.
-
teb ✭✭@Genevieve P.Well, this formula got me closer than I have ever been. So, thank you for that. I received an error message that the rows have to be next to one another in order to be included. My rows will not be next to one another. Is there a way to accommodate that issue? Thank you for your help.
-
Genevieve P. Employee AdminHi@teb
Can you post the formula you're using, the exact error message you're receiving, and a screen capture of both sheets? (With sensitive data blocked out).
-
teb ✭✭@Genevieve P.I hope this is helpful. I appreciate your assistance. Thank you!
-
Genevieve P. Employee AdminHi@teb
Thank you for this, but we're still missing some information. I see here the column you want to return, so the multiple values you want to bring back (Test 1, Test 2, etc), but how do you know what rows you're looking for?
What's the unique identifier across your sheets? What tells the formula in Sheet 2 that those three Tests are all associated with one another? Think of it like putting a filter on: what filter criteria do you apply to Sheet 1 so only those 3 rows appear?
For example, if this is your Source Sheet (Sheet 1 in your image):
Then you can see that the "Unique Value" column has 3 cells that contain the same value, "yyy".
I can use this in the JOIN(COLLET to bring back the 3 data points in the Bill Number column because they have the same criteria in the Unique Value column:
=JOIN(COLLECT({Bill Number}, {Unique Value}, "yyy"), ", ")
Help Article Resources
Categories
Check out theFormula Handbook template!
@SarahI<\/a> Yes you can do that just use CHILDREN([COLUMN NAME])<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":106901,"type":"question","name":"Can you use a COUNTIF formula to county symbols?","excerpt":"I have a list of goals for the year and we are using harvey ball symbols to indicate the percent complete an the red, yellow, green, gray balls to indicate the health\/status of the project. I would like to display a report on my dashboard that shows the number of projects we have in each harvey ball stage and also in each…","categoryID":322,"dateInserted":"2023-06-26T15:59:48+00:00","dateUpdated":"2023-06-26T16:00:12+00:00","dateLastComment":"2023-06-26T16:29:45+00:00","insertUserID":162764,"insertUser":{"userID":162764,"name":"Stephanie D","title":"Program Manager","url":"https:\/\/community.smartsheet.com\/profile\/Stephanie%20D","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!mctWfgWrL7o!n-DX3ymVfmQ!msa32mT4_k9","dateLastActive":"2023-06-26T16:52:22+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162764,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-06-26T20:04:25+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":25,"score":null,"hot":3375593973,"url":"https:\/\/community.smartsheet.com\/discussion\/106901\/can-you-use-a-countif-formula-to-county-symbols","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106901\/can-you-use-a-countif-formula-to-county-symbols","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106901,"commentID":382346,"name":"Re: Can you use a COUNTIF formula to county symbols?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382346#Comment_382346","dateInserted":"2023-06-26T16:29:45+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-06-26T20:04:25+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T16:24:48+00:00","dateAnswered":"2023-06-26T16:08:42+00:00","acceptedAnswers":[{"commentID":382328,"body":" Hi @Stephanie D<\/a> <\/p> I hope you're well and safe!<\/p> Try something like this.<\/p> =COUNTIF(Status:Status, \"Green\")<\/p> =COUNTIF([% Complete]:[% Complete], \"Half\")<\/p> Did that work\/help? <\/p> I hope that helps!<\/p> Be safe, and have a fantastic week!<\/p> Best,<\/p> Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p> ✅Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

