Vlookup from another sheet to copy formula number

Hello,

I am trying to determine how to get a cell copied into a sheet from another sheet based on certain criteria using a vlookup formula.

Here is the sheet i would want the formula to autofill in. When Gunma (Asahi) and Aussie lemonade are chosen, I would like the formula number to autofill pulling from another sheet.

image.png

So the formula would need to Vlookup into the sheet below and find the formula number based on the product "aussie" and Copacker "Asahi"


image.png


What formula would i enter in the formula number column to make it search the second sheet to find the correct formula number?

Answers

  • Leibel S
    Leibel S ✭✭✭✭✭✭

    @tchav

    试试以下:

    =INDEX(COLLECT({Formula},{ob欧宝娱乐app手机下载},CONTAINS(@cell,[email protected]),{copacker},CONTAINS(@cell,[email protected])),1)

    Make sure to update the bolded cross sheet references

  • tchav
    tchav
    edited 04/03/23

    I did this and it still isnt working

    =INDEX(COLLECT({HBC Master File by Site 20230324 Range 4}, {HBC Master File by Site 20230324 Range 2}, CONTAINS(@cell,[email protected]), {HBC Master File by Site 20230324 Range 3}, CONTAINS(@cell,[email protected])), 1)


    @Leibel S


    image.png


  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Try switching the arguments around in both of the CONTAINS functions.

    CONTAINS([email protected], @cell)

    thinkspi.com

  • tchav
    tchav
    edited 04/04/23

    @Paul Newcome@Leibel SIt worked finally after some trial and error. Thank you for your help.


    One more question:

    What would I put in the formula to give an error if there are multiple of thesameproduct listed in the sheet? Sometimes we have the same products with multiple different formulas and right now it is grabbing the first formula. I want there to be an error if there are multiple different formulas for the same product.


    =INDEX(COLLECT({HBC Master File by Site 20230324 Range 1}, {HBC Master File by Site 20230324 Range 2}, CONTAINS(@cell,[email protected]), {HBC Master File by Site 20230324 Range 3}, CONTAINS(@cell,[email protected])), 1)

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    You would need to use an IF/COUNTIFS combo. Basically you would use a COUNTIFS to count how many rows there are matching the same range/criteria sets you have in your COLLECT (not including the very first range) then say IF that is greater than 1 then output "this error", otherwise run the INDEX/COLLECT.


    =IF(COUNTIFS(..........)> 1, "error message", INDEX/COLLECT)

    thinkspi.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册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":106886,"type":"question","name":"Risk and Opportunity Matrix - IF\/AND Statements","excerpt":"Hello, I am trying to utilize a Risk & Opportunity Matrix to assign priority levels to risks and opportunities. I am using this formula to try to do this but I keep getting an #INCORRECT ARGUMENT. Does anyone know why? I even tried a test with only one IF\/AND statement to see if it works and I still get the same message.…","categoryID":322,"dateInserted":"2023-06-26T13:58:31+00:00","dateUpdated":"2023-06-26T14:10:30+00:00","dateLastComment":"2023-06-26T15:19:16+00:00","insertUserID":162759,"insertUser":{"userID":162759,"name":"sophiaashepard","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/sophiaashepard","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T15:30:21+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162759,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T15:19:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":20,"score":null,"hot":3375581867,"url":"https:\/\/community.smartsheet.com\/discussion\/106886\/risk-and-opportunity-matrix-if-and-statements","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106886\/risk-and-opportunity-matrix-if-and-statements","format":"Rich","lastPost":{"discussionID":106886,"commentID":382299,"name":"Re: Risk and Opportunity Matrix - IF\/AND Statements","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382299#Comment_382299","dateInserted":"2023-06-26T15:19:16+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T15:19:24+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,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/AXPIZGR6E5VK\/matrix-png.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Matrix.PNG"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T15:30:19+00:00","dateAnswered":"2023-06-26T15:19:16+00:00","acceptedAnswers":[{"commentID":382299,"body":"

Looks like you are forgetting to close out your AND function(s).<\/p>

=IF(AND(.......), <\/strong>\"Critical\")<\/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":106881,"type":"question","name":"Calculate % complete with Date Range and Today's date","excerpt":"Hello community, I need a formula to return % Complete based on a start - end date range and today's date. So for example: Date Range: 06\/18\/23 - 06\/30\/23 Today's date: 06\/26\/23 As there are 12days in this date range, and today's date is day 8 out of 12, the percentage complete would be 66.6% Thanks in advance!","categoryID":322,"dateInserted":"2023-06-26T11:40:17+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T15:14:49+00:00","insertUserID":143463,"insertUser":{"userID":143463,"name":"Sam Swain","url":"https:\/\/community.smartsheet.com\/profile\/Sam%20Swain","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T15:15:08+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T15:19:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":44,"score":null,"hot":3375575706,"url":"https:\/\/community.smartsheet.com\/discussion\/106881\/calculate-complete-with-date-range-and-todays-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106881\/calculate-complete-with-date-range-and-todays-date","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106881,"commentID":382293,"name":"Re: Calculate % complete with Date Range and Today's date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382293#Comment_382293","dateInserted":"2023-06-26T15:14:49+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T15:19:24+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-26T13:50:37+00:00","dateAnswered":"2023-06-26T13:24:44+00:00","acceptedAnswers":[{"commentID":382268,"body":"

=MAX(MIN((TODAY() - Start@row) \/ (Finish@row - Start@row), 1), 0)<\/p>


<\/p>

This does the percentage:<\/p>

(TODAY() - Start@row) \/ (Finish@row - Start@row)<\/p>


<\/p>

This caps it at 100%:<\/p>

MIN(..............., 1)<\/p>


<\/p>

This keeps it from going negative for future tasks:<\/p>

MAX(..............., 0)<\/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":[]}">

Trending in Formulas and Functions