{"id":893,"date":"2023-06-20T16:12:20","date_gmt":"2023-06-20T08:12:20","guid":{"rendered":"https:\/\/www.info-trek.com\/blog\/?p=893"},"modified":"2024-05-02T12:09:20","modified_gmt":"2024-05-02T04:09:20","slug":"how-to-return-multiple-return-using-one-id-with-excel-part-2","status":"publish","type":"post","link":"https:\/\/www.info-trek.com\/blog\/how-to-return-multiple-return-using-one-id-with-excel-part-2\/","title":{"rendered":"How to return multiple return using one ID with EXCEL Part.2"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Explanation<\/h4>\n\n\n\n<p><strong>Explanation Part 1 \u2013 IF() and ROW()<\/strong><\/p>\n\n\n\n<p>IF() function is to test whether the ID in the ID column matches with the one located in the cell E2. Wherever it matches, it will return the ROW number of the matched ID, else empty string.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2-1024x407.gif\" alt=\"\" class=\"wp-image-5284\"\/><\/figure>\n\n\n\n<p>But if your eyes are sharp enough, you will be able to learn about the output area. The first few output from the Function Argument dialog box is display eight of =&gt; \u201c\u201d and the starting from the 9<sup>th<\/sup>&nbsp;the output is displayed as number.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.1.png\" alt=\"\" class=\"wp-image-5285\"\/><\/figure>\n\n\n\n<p>Among the IDs in the column of ID from \u201cpaid\u201d table, starting from the 9<sup>th<\/sup>&nbsp;, the IF function has found the match with the reference E2. Hence when you look at the output are as highlighted in red in the figure above, it displays number (the row number) instead of. You must be curious why should I deduct 1 from the ROW() function. Simply because we do not need to know which row the match is from, but we want to start the index counting from 1. If without deducting 1 from the ROW function, the Index will start from 2.<\/p>\n\n\n\n<p>The rest of the output are FALSE because those are not match compare to the reference in E2, hence \u201c\u201d is being returned.<\/p>\n\n\n\n<p>Forgot to mentioned, this is an ARRAY formula. So once you\u2019ve finished with the formula, don\u2019t forget to&nbsp;<strong>CRTL + SHIFT + ENTER.<\/strong><\/p>\n\n\n\n<p><strong>Explanation Part 2 \u2013SMALL() and ROWS()<\/strong><\/p>\n\n\n\n<p>In order for us to retrieve the index of the first match, we will be needing the function SMALL(). With this function, we will be able to extract the first smallest number from the output from the IF() function.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.2.png\" alt=\"\" class=\"wp-image-5286\"\/><\/figure>\n\n\n\n<p>So now I will be using SMALL() function to nest the IF function within it. Then we will need to extract the 2<sup>nd<\/sup>&nbsp;smallest the 3<sup>rd<\/sup>&nbsp;smallest etc.&nbsp; &lt;= the 1<sup>st<\/sup>, 2<sup>nd<\/sup>&nbsp;and Nth amount of the we will be using ROWS() function to return the cell count. To get the cell count, ROWS() function will be used.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.3-1024x348.gif\" alt=\"\" class=\"wp-image-5287\"\/><\/figure>\n\n\n\n<p><strong>Explanation Part 3 \u2013Index()<\/strong><\/p>\n\n\n\n<p>Extracting or retrieving the value from Date column using Index function. Index function is known to retrieve value from a series of an array based of the given position number. Since part 1 to part 2, we\u2019ve been busy retrieving the position number of the ID, now it\u2019s time to put it to good use. Check out the .gif below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.4-1024x587.gif\" alt=\"\" class=\"wp-image-5288\"\/><\/figure>\n\n\n\n<p><strong>Explanation Part 4 \u2013IFERROR()<\/strong><\/p>\n\n\n\n<p>If you do realize that there are a few error output at the bottom part, simply because when the N<sup>th&nbsp;<\/sup>&nbsp;smallest number is not found in the array, #NUM! will be returned. Another explanation will be \u201c<em>Whenever, the Nth is exceeded the amount of count of number stated in the array the same output will be returned.\u201d<\/em><\/p>\n\n\n\n<p>IFERROR() function will be use to surround the nested function from prt1 and prt 2, to return a different output instead of #NUM!. What we want is return empty string \u201c\u201d. This is how it goes..<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.5-1024x535.gif\" alt=\"\" class=\"wp-image-5289\"\/><\/figure>\n\n\n\n<p><strong>Explanation Part 5 \u2013Copy and Paste the formula to Amt Column<\/strong><\/p>\n\n\n\n<p>We\u2019re almost there. To complete the whole search table, we will need to copy the formula from Date column to the Amt column. There are many ways that you can copy a formula from one location to another. Below, I show you different ways to copy your formula. You\u2019re not going to just copy and paste the formula, we will be doing a little adjustment which is changing the array in the Index() function.<\/p>\n\n\n\n<p><strong>Ctrl C Ctrl V<\/strong><\/p>\n\n\n\n<p><strong>Ctrl C<\/strong>&nbsp;the cell contains the formula and&nbsp;<strong>Ctrl V<\/strong>&nbsp;at the destination.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.6-1024x507.gif\" alt=\"\" class=\"wp-image-5290\"\/><\/figure>\n\n\n\n<p><strong>Ctrl R<\/strong><\/p>\n\n\n\n<p>Ctrl R is another favourite option of mine whenever I would like to copy the formula towards to the adjacent column (which is to the right). In order to do that, you will need to highlight the cell that contains the formula, and then the destination (cell\/ range) that you would like to copy to. Finally apply your keystroke&nbsp;<strong>Ctrl R<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.7-1024x519.gif\" alt=\"\" class=\"wp-image-5291\"\/><\/figure>\n\n\n\n<p><strong>Paste as Fx<\/strong><\/p>\n\n\n\n<p>Pasting as a formula is also another good option. The best thing about this option is, it will not paste the formatting from the cell before to the destination cell, but just the formula.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.info-trek.com\/blog\/wp-content\/uploads\/2019\/03\/Multiple-Return-P2.8-1024x499.gif\" alt=\"\" class=\"wp-image-5292\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Explanation Explanation Part 1 \u2013 IF() and ROW() IF() function is to test whether the ID in the ID column matches with the one located in the cell E2. Wherever it matches, it will return the ROW number of the matched ID, else empty string. But if your eyes are sharp enough, you will be [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":581,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/comments?post=893"}],"version-history":[{"count":1,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/posts\/893\/revisions"}],"predecessor-version":[{"id":894,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/posts\/893\/revisions\/894"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/media\/581"}],"wp:attachment":[{"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/media?parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/categories?post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.info-trek.com\/blog\/wp-json\/wp\/v2\/tags?post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}