Check Another Sheet for Value across Multiple Columns
In Sheet 2, I am looking to search Sheet 1 for an instance of a value, that could be in one of four columns.
Sheet 1
COLUMN A | COLUMN B | COLUMN C | COLUMN D | COLUMN E |
ABS 123 | March | 26444 | | 43454 |
ABS 456 | June | 87834 | 45003 | |
ABS 789 | August | | | |
ABS 000 | October | | | 36543 |
There are four order numbers in Sheet 1 (ABS 123, ABS 456, etc.) in Column A. Column is the month the order was processed. Columns C to E represent different phases in processing. There may be a processing number in one of the columns.
In Sheet 2, I'd like to find instances of the order number and processing number. For example, if I "search" for ABS 123 and 26444, it would report "March", because it searched Column A and Columns C to E for both the order number in Column A (ABS 123) and the processing number in Columns C, D, and E (26444), and if found, displays the month in Column B (March). Otherwise, it displays "N/A".
Sheet 2
COLUMN A | COLUMN B | COLUMN C
ABC 012 | 23000 |N/A
ABC 123 | 26444 |March
ABC 123 | 32322 |N/A
ABC 123 | 43454 |March
ABC 331 | 42232 |N/A
ABC 456 | 45003 |June
ABC 456 | 87834 |June
ABC 789 | 12345 |N/A
ABC 000 | 36543 |October
Sheet 2 already contains information in Columns A and B. The formula appears in Column C, which references Sheet 1 and looks for the value in Column A from Sheet 2 in Column A of Sheet 1 and Column B from Sheet 2 in Columns C to E of Sheet 1 and either displays the value of Column B of Sheet 2 or N/A (not found).
I get how to use the INDEX/MATCH function, but not sure how to have it look for a value (Column B in Sheet 2) in multiple columns (C, D, and E) in Sheet 1.
Thanks for your guidance!
Comments
-
Paul Newcome ✭✭✭✭✭✭
Try something like this...
=INDEX({Month}, MATCH([Column A]@row, {Column A}, 0), IF(MOD(MATCH([Column B]@row, {Columns C - E}, 0), 3) = 0, 3, MOD(MATCH([Column B]@row, {Columns C - E}, 0), 3)))
EDIT:
Please note: The divisor within the MOD function would be however many columns you are using in your range. The number in the "if_true" section of the IF statement will also be the same as the number of columns you have in your range.
thinkspi.com
-
Paul Newcome ✭✭✭✭✭✭
Please disregard the above solution. It is not what you are looking for. I will do some more testing and see what I can come up with.
My apologies.
thinkspi.com
-
Chiu Bar ✭✭
Hello@Paul Newcome,
This is an interesting topic and it is similar to what I am currently working on.
Do you happen to have an update on this?
Your help will be greatly appreciated.
Cheers!
-
Genevieve P. Employee Admin
Can you clarify your specific scenario? (E.g. what your source sheet looks like, what you want to bring back into your new sheet). Screen captures would be helpful, but please block out sensitive data
-
Chiu Bar ✭✭
Hello@Genevieve P.,
Sheet 1 has the following columns:
Data is drawn from a form with each row representing a data set.
Second through third columns of Sheet 2 contains formula to determine the entries provided for each Property Name and expected to have the following results:
I was able to the get the count on theNo. of Submissionsby applying theformula on Column 2:COUNTIF({[Sheet 1] Property Names}, =[Property Name]@row).
Where[Sheet 1] Property Namesencompasses columnsType A,Type B, andType C.
However, I was unsuccessful in determining the value forAssigned Teamfor each row underProperty Nameusing this formula:INDEX({[Sheet 1] Assigned Team}, MATCH([Property Name]@row, {[Sheet 1] Property Names}, 0)).
An empty value came out on the cell, though.
What do you think is wrong with the formula that I have applied?
Any help will be greatly appreciated.
-
Genevieve P. Employee Admin
Thanks for clarifying! This is really helpful.
What would you like to happen if there are more than one values in the source sheet? For example:
What I would do here is use 3 separate JOIN(COLLECT formulas, each looking at an individual Type column, like so:
=JOIN(COLLECT({Assigned Team}, {Type A}, [Property Name]@row), CHAR(10)) + CHAR(10) + JOIN(COLLECT({Assigned Team}, {Type B}, [Property Name]@row), CHAR(10)) + CHAR(10) + JOIN(COLLECT({Assigned Team}, {Type C}, [Property Name]@row), CHAR(10))
Then I'd put this in a multi-select column so that the multiple options show up:
Cheers,
Genevieve
-
Chiu Bar ✭✭
Thanks@Genevieve P.
-
Chiu Bar ✭✭
Hello again@Genevieve P.
I have applied the formula on the "No. of Submissions" column. However, when I need to get the aggregate (using the SUM function) on the said column, it returns no value.
I have modified the same column to make it as "=[Property Name]@row" and still returns no value.
May I be further guided on this.
Thank you
-
Genevieve P. Employee Admin
Can you post screen captures of your sheet and the current formula you're trying? (But please block out sensitive data)
-
Chiu Bar ✭✭
Thanks for the quick reply@Genevieve P..
In reference to the above screenshot, the formula applied on the yellow cells are similar to:
=JOIN(COLLECT({Assigned Team}, {Type A}, [Property Name]@row), CHAR(10)) + CHAR(10) + JOIN(COLLECT({Assigned Team}, {Type B}, [Property Name]@row), CHAR(10)) + CHAR(10) + JOIN(COLLECT({Assigned Team}, {Type C}, [Property Name]@row), CHAR(10))
Taking the sum on selected cells (for testing purposes) gave a zero value.
If I use "+" on the values, it resulted to concatenation of the values.
Any thoughts for a workaround?
-
Genevieve P. Employee Admin
Thank you, this helps!
It looks like the JOIN formulas are bringing together the values so they're seen as text, not numerical. Can I ask why you've switched to JOIN from the COUNTIF formula above?
You should be able to add the results of a COUNTIF formula with other results to get a number. When you say that the formula is "similar" to the JOIN formula above, is it the same but referencing a different column? Or are you using COUNTIFs? This is the formula we'll want to look at so that you can eventually SUM the results.
-
Chiu Bar ✭✭
I was able to find a workaround using the VALUE function (helper column).
Thank you, though :-)
-
Genevieve P. Employee Admin
I'm glad you found something that works for you! However keep in mind that if your previous formula is reading the numbers as text values, it might place two values together (like: 6 and 6 to show 66). Then the VALUE function will read this as 66 instead of 12. Is that a possibility?
I would recommend adding multiple COUNTIFS together instead of using JOIN if you are looking into multiple sheets:
=COUNTIFS(....) + COUNTIFS(....) + COUNTIFS(....)
This should give you the correct value across sheets and eliminate the need for a helper VALUE function.
Help Article Resources
Categories
I hope you're well and safe!<\/p>
Unfortunately, it's not possible now, but it's an excellent idea!<\/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> Here's a possible workaround or workarounds <\/strong><\/p> Would 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":[]},{"discussionID":106637,"type":"question","name":"How can I sum cells that include the abbreviation of states, but include commas in between?","excerpt":"As of right now I am summing selected cells, which then gives me everything that is in those cells. It is then merging them together, but I need it to include a comma if there is more than 1 cell that has information in it.","categoryID":322,"dateInserted":"2023-06-20T14:46:57+00:00","dateUpdated":null,"dateLastComment":"2023-06-20T15:31:02+00:00","insertUserID":151023,"insertUser":{"userID":151023,"name":"haley brianne","title":"","url":"https:\/\/community.smartsheet.com\/profile\/haley%20brianne","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nW1W8KHNFR845.png","dateLastActive":"2023-06-20T15:21:53+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-20T18:40:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":39,"score":null,"hot":3374551679,"url":"https:\/\/community.smartsheet.com\/discussion\/106637\/how-can-i-sum-cells-that-include-the-abbreviation-of-states-but-include-commas-in-between","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106637\/how-can-i-sum-cells-that-include-the-abbreviation-of-states-but-include-commas-in-between","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106637,"commentID":381333,"name":"Re: How can I sum cells that include the abbreviation of states, but include commas in between?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381333#Comment_381333","dateInserted":"2023-06-20T15:31:02+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-20T18:40:04+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\/0Z0RK4QSFIJG\/screenshot-2023-06-20-at-9-45-30-am.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Screenshot 2023-06-20 at 9.45.30 AM.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-20T15:22:33+00:00","dateAnswered":"2023-06-20T15:11:00+00:00","acceptedAnswers":[{"commentID":381325,"body":" Try this instead:<\/p> =JOIN(COLLECT([Dash Columns]12:[Dash Columns]61, [Dash Columns]12:[Dash Columns]61, @cell <> \"//www.santa-greenland.com/community/discussion/52851/\"), \", \")<\/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"}]},{"discussionID":106627,"type":"question","name":"Automated due date for every Monday","excerpt":"I have several reports that I run. I have a SmartSheet that lists how often it runs (Daily, weekly or monthly). I have an equation that calculates the next due date based on the completion date. The completion date is automatically recorded when I complete the report. It works beautifully except for the times that weekly…","categoryID":322,"dateInserted":"2023-06-20T12:08:03+00:00","dateUpdated":null,"dateLastComment":"2023-06-20T13:15:59+00:00","insertUserID":120783,"insertUser":{"userID":120783,"name":"Lisa Vercellone","url":"https:\/\/community.smartsheet.com\/profile\/Lisa%20Vercellone","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-20T16:08:37+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":120783,"lastUser":{"userID":120783,"name":"Lisa Vercellone","url":"https:\/\/community.smartsheet.com\/profile\/Lisa%20Vercellone","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-20T16:08:37+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":25,"score":null,"hot":3374531042,"url":"https:\/\/community.smartsheet.com\/discussion\/106627\/automated-due-date-for-every-monday","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106627\/automated-due-date-for-every-monday","format":"Rich","lastPost":{"discussionID":106627,"commentID":381284,"name":"Re: Automated due date for every Monday","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381284#Comment_381284","dateInserted":"2023-06-20T13:15:59+00:00","insertUserID":120783,"insertUser":{"userID":120783,"name":"Lisa Vercellone","url":"https:\/\/community.smartsheet.com\/profile\/Lisa%20Vercellone","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-20T16:08:37+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\/7LJZYGRS3588\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-20T13:17:21+00:00","dateAnswered":"2023-06-20T12:22:38+00:00","acceptedAnswers":[{"commentID":381263,"body":" Incorporate the below into your formula it will give you the Monday following the last completed date.<\/p> =[Completed Date]@row - (WEEKDAY([Completed Date]@row) - 2)+7<\/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":[]}],"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":[]}">