Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

Formula: Look Up for two value

Peter Smith
edited 12/09/19 inArchived 2017 Posts

Hi,

This one is pretty easy in Excel but I have no idea how to do that in SmartSheet.

I have 3 columns in SS: Fruit, Brand and Price

[Fruit]1 is Apple , [Brand]1 is ABC Ltd. [Price]1 is 100

[Fruit]2 is Apple , [Brand]1 is XYZ Ltd. [Price]1 is 50

[Fruit]3 is Pear, [Brand]1 is ABC Ltd. [Price]1 is 100

I want to have formula to find price of XYZ Ltd Apple, the answer should be 50.

How can I do it in SS?

Comments

  • ricki
    ricki ✭✭✭✭✭✭

    If you only will have one row that matches you could try to use sumifs

    =SUMIFS([Price]:[Price], Fruit:Fruit, "Apple", Brand:Brand, "XYZ")

  • Sorry we need to add one more column, date arrive . Now, if we need to look for date instead of price for two critera, which formula we can use

    E.g., look for date arrive for apple and ABC Ltd.

    我尝试使用新的公式,收集也不工作

    Thanks

  • ricki
    ricki ✭✭✭✭✭✭

    Looks like you can do something with the new collect function

    https://help.smartsheet.com/function/collect

    =AVG(COLLECT([Date Arrive]:[Date Arrive], [Fruit]:[Fruit], "Apple", [Brand]:[Brand], "XYZ"))

  • Hi,

    It shows invalid column value.

    = AVG(收集([日期接收]1:接收日期2, Fruit1:Fruit2, "Apple", Company1:Company2, "XYZ 123 Ltd"))

    May be because I set the date to receive column as date. If I put number instead of date, its work. But this one should be set up as date

    I do not need to have any calculation. I just need to show the date to receive.

    If the formula is right, it should shows Sep 18, 2017. I just want to get answer if I look up for "Apple" and "XYZ 123 Td)

    Fruit Company Date to receive

    Apple ABC123 Ltd 06/06/17

    Apple XYZ 123 Ltd 09/18/17

    Thanks

  • sorry , fat finger.

    I just want to get answer if I look up for "Apple" and "XYZ 123 Ltd"

    Thanks

  • ricki
    ricki ✭✭✭✭✭✭

    I got a similar error when there was no match in the range of data I was looking at. I think the issue here is that you want to be searching the whole column so you need to remove the numbers

    ie you have ([Date to receive]1:[Date to receive]2 but it should really be ([Date to receive]:[Date to receive]

    You need the avg function because the collect just returns the collection

    I used the following in my test smartsheet and it returned the expected date (column2 and column3 were my actual column names)

    =AVG(COLLECT([Due Date]:[Due Date], [Column2]:[Column2], "Sprint 1", [Column3]:[Column3], "2"))

    The field I put this formula into was a date field (called TestDate). What column did you put your formula into?

    I was also sometimes getting an error because I didn't have brackets around the field names (even though they were only one word). So you may want to try [Fruit]1:[Fruit]2 or [Fruit]:[Fruit]

  • Ricki:

    The formula is work now. Tricky thing is I forget to set column property as Date (I type formula in column and I find out the column property default as text/number)

    Thanks

This discussion has been closed.
Hi Dear Andrée Starå<\/strong><\/a><\/p>

Thank you so much for your solution!<\/p>

It can work, but more like a compromise way. Editing on a report is less convenient.<\/p>

It would be better for me to set access right to each column.<\/p>

But that can also work for now, thanks a lot.<\/p>

By the way are you a BOT?<\/p>"},{"commentID":383283,"body":"

@流风回雪<\/a> <\/p>

Excellent!<\/p>

Happy to help!<\/p>

I agree. Great idea! That would be a great addition to Smartsheet features.<\/p>

Please submit this as a Product Feedback or Idea <\/strong>(If it hasn't been added already)<\/em><\/strong> when you have a moment.<\/strong><\/a><\/p>

Haha!, No, I'm not a bot! 🤣<\/span><\/p>

Remember! <\/strong>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":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":107118,"type":"question","name":"I am trying to replicate a formula, but it is changing all the formulas on the page","excerpt":"I am trying to create the formula in the \"Activities\" row, to the \"Issues\/Pain points\" row with a different reference column. I also need to change the reference sheet, but I want to get this formula right in the first instance. Can anyone help?","snippet":"I am trying to create the formula in the \"Activities\" row, to the \"Issues\/Pain points\" row with a different reference column. I also need to change the reference sheet, but I want…","categoryID":322,"dateInserted":"2023-06-30T00:39:34+00:00","dateUpdated":null,"dateLastComment":"2023-06-30T04:19:52+00:00","insertUserID":163030,"insertUser":{"userID":163030,"name":"Tamar","url":"https:\/\/community.smartsheet.com\/profile\/Tamar","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T04:37:17+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":122388,"lastUser":{"userID":122388,"name":"Matt Johnson","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Matt%20Johnson","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/ZX2A39HRG0VO\/nLJJDDQXUVD4H.JPG","dateLastActive":"2023-06-30T13:26:03+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":21,"score":null,"hot":3376184966,"url":"https:\/\/community.smartsheet.com\/discussion\/107118\/i-am-trying-to-replicate-a-formula-but-it-is-changing-all-the-formulas-on-the-page","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107118\/i-am-trying-to-replicate-a-formula-but-it-is-changing-all-the-formulas-on-the-page","format":"Rich","lastPost":{"discussionID":107118,"commentID":383258,"name":"Re: I am trying to replicate a formula, but it is changing all the formulas on the page","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/383258#Comment_383258","dateInserted":"2023-06-30T04:19:52+00:00","insertUserID":122388,"insertUser":{"userID":122388,"name":"Matt Johnson","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Matt%20Johnson","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/ZX2A39HRG0VO\/nLJJDDQXUVD4H.JPG","dateLastActive":"2023-06-30T13:26:03+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\/HUYT81EVYVIV\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-30T04:41:02+00:00","dateAnswered":"2023-06-30T04:19:52+00:00","acceptedAnswers":[{"commentID":383258,"body":"

Hi @Tamar<\/a> <\/p>

I think this is happening becuase you are editing a range that exists in the original location. Instead of editing the range in the new location, be sure to delete the entire range and then click in the place where it was in the formula. Then choose another range. <\/p>

I hope that helps.<\/p>

Matt<\/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":107085,"type":"question","name":"Using INDEX\/MATCH to pull a date and CountIF not recognizing as a date","excerpt":"Hi, I'm using INDEX\/MATCH to pull a date from one report into another based on the same ID number. If there is no match, an error message populates. =IFERROR(INDEX({Corporate CAPA Closed Effective Date}, MATCH([InfoCard Number]@row, {Corporate CAPA Closed InfoCard Number}, 0)), \"CAPA Not Closed\") Once the formula is…","snippet":"Hi, I'm using INDEX\/MATCH to pull a date from one report into another based on the same ID number. If there is no match, an error message populates. =IFERROR(INDEX({Corporate CAPA…","categoryID":322,"dateInserted":"2023-06-29T15:11:26+00:00","dateUpdated":null,"dateLastComment":"2023-06-30T11:58:32+00:00","insertUserID":146974,"insertUser":{"userID":146974,"name":"Jack Parry","url":"https:\/\/community.smartsheet.com\/profile\/Jack%20Parry","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-29T20:28:15+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-30T12:55:57+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":34,"score":null,"hot":3376179598,"url":"https:\/\/community.smartsheet.com\/discussion\/107085\/using-index-match-to-pull-a-date-and-countif-not-recognizing-as-a-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107085\/using-index-match-to-pull-a-date-and-countif-not-recognizing-as-a-date","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":107085,"commentID":383295,"name":"Re: Using INDEX\/MATCH to pull a date and CountIF not recognizing as a date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/383295#Comment_383295","dateInserted":"2023-06-30T11:58:32+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-30T12:55:57+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-29T20:28:12+00:00","dateAnswered":"2023-06-29T17:10:07+00:00","acceptedAnswers":[{"commentID":383157,"body":"

The INDEX function should be retaining the data type (in this case date value). It sounds like the issue is that there is at least one blank or no-date value within the range. To accommodate that you would use:<\/p>


<\/p>

=COUNTIFS({All Sites CAPA}, CONTAINS(\"CAPA\", @cell), {All Sites CAPA Effective Date}, IFERROR(<\/strong>MONTH(@cell), 0)<\/strong> = 6, {All Sites CAPA Closed On Time?}, CONTAINS(\"CAPA Overdue\", @cell))<\/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&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&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 Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts