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
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 ✭✭✭✭✭✭
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 ✭✭✭✭✭✭
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 ✭✭✭✭✭✭
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
Categories
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":107113,"type":"question","name":"How to return a BLANK if we have a BLANK cell using a COUNTIFS formula","excerpt":"This formula is currently working, and it is returning how many items are reviewed for each \"Project Lead\". The first part of the formula is basically saying that we would count them, as long as we have a \"Reviewer\" name added in the \"Reviewer\" column. =IFERROR(COUNTIFS(Reviewer:Reviewer, <>\"//www.santa-greenland.com/community/discussion/comment/\", [Project Lead]:[Project…","snippet":"This formula is currently working, and it is returning how many items are reviewed for each \"Project Lead\". The first part of the formula is basically saying that we would count…","categoryID":322,"dateInserted":"2023-06-29T22:39:31+00:00","dateUpdated":null,"dateLastComment":"2023-06-30T02:51:05+00:00","insertUserID":157974,"insertUser":{"userID":157974,"name":"Filippo","url":"https:\/\/community.smartsheet.com\/profile\/Filippo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T03:08:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":157974,"lastUser":{"userID":157974,"name":"Filippo","url":"https:\/\/community.smartsheet.com\/profile\/Filippo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T03:08:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":24,"score":null,"hot":3376173036,"url":"https:\/\/community.smartsheet.com\/discussion\/107113\/how-to-return-a-blank-if-we-have-a-blank-cell-using-a-countifs-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107113\/how-to-return-a-blank-if-we-have-a-blank-cell-using-a-countifs-formula","format":"Rich","lastPost":{"discussionID":107113,"commentID":383252,"name":"Re: How to return a BLANK if we have a BLANK cell using a COUNTIFS formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/383252#Comment_383252","dateInserted":"2023-06-30T02:51:05+00:00","insertUserID":157974,"insertUser":{"userID":157974,"name":"Filippo","url":"https:\/\/community.smartsheet.com\/profile\/Filippo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T03:08:32+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-30T02:51:53+00:00","dateAnswered":"2023-06-29T22:55:01+00:00","acceptedAnswers":[{"commentID":383233,"body":"
@Filippo<\/a>, the most inelegant but dead simple thing to do is this:<\/p>
Simplified, it's just this:<\/p>