<https://forum.ozgrid.com/forum/index.php?thread/1229424-count-skips-between-last-occurrence/&pageNo=2>
<http://schema.org/articleBody>
"Sheet1\n\nID\nDate\nN1\nN2\nN3\nN4\nN5\n\n\n847\n2/27/2021\n10\n16\n17\n24\n36\n\n848\n2/28/2021\n6\n9\n13\n14\n22\n\n849\n3/1/2021\n2\n6\n18\n23\n33\n\n850\n3/2/2021\n9\n15\n20\n27\n34\n\n851\n3/3/2021\n19\n22\n23\n24\n35\n\n852\n3/4/2021\n6\n13\n20\n33\n36\n\n853\n3/5/2021\n3\n14\n15\n20\n36\n\n854\n3/6/2021\n1\n12\n15\n20\n43\n\n855\n3/7/2021\n11\n15\n16\n18\n43\n\n856\n3/8/2021\n16\n30\n31\n39\n40\n\n857\n3/9/2021\n3\n20\n25\n30\n43\n\n858\n3/10/2021\n18\n20\n25\n28\n29\n\n859\n3/11/2021\n2\n10\n13\n29\n30\n\n860\n3/12/2021\n5\n18\n19\n38\n39\n\n861\n3/13/2021\n5\n11\n20\n21\n26\n\n862\n3/14/2021\n7\n12\n25\n28\n41\n\n863\n3/15/2021\n13\n37\n38\n39\n43\n\n864\n3/16/2021\n3\n10\n11\n22\n41\n\n865\n3/17/2021\n15\n16\n17\n19\n37\n\n866\n3/18/2021\n18\n24\n28\n31\n39\n\n867\n3/19/2021\n5\n13\n22\n27\n34\n\n868\n3/20/2021\n15\n16\n21\n24\n37\n\n869\n3/21/2021\n13\n14\n18\n24\n29\n\n870\n3/22/2021\n9\n18\n32\n33\n34\n\n871\n3/23/2021\n1\n12\n18\n32\n36\n\n872\n3/24/2021\n6\n8\n13\n29\n36\n\n873\n3/25/2021\n9\n12\n16\n20\n35\n\n874\n3/26/2021\n6\n28\n33\n36\n39\n\n875\n3/27/2021\n6\n7\n22\n23\n32\n\n876\n3/28/2021\n2\n6\n11\n13\n31\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSheet2\n#\nSBLO\n\n1\n5\n\n2\n0\n\n3\n12\n\n4\n47\n\n5\n9\n\n6\n0\n\n7\n1\n\n8\n4\n\n9\n3\n\n10\n12\n\n11\n0\n\n12\n3\n\n13\n0\n\n14\n7\n\n15\n8\n\n16\n3\n\n17\n11\n\n18\n5\n\n19\n11\n\n20\n3\n\n21\n8\n\n22\n1\n\n23\n1\n\n24\n6\n\n25\n14\n\n26\n15\n\n27\n9\n\n28\n2\n\n29\n4\n\n30\n17\n\n31\n0\n\n32\n1\n\n33\n2\n\n34\n6\n\n35\n3\n\n36\n2\n\n37\n8\n\n38\n13\n\n39\n2\n\n40\n20\n\n41\n12\n\n42\n37\n\n43\n13\n\n\nSheet1 contains a list of drawings. The numbers are in Columns C through G. One row for each drawing.\nSheet2 contains numbers 1-43 of which 5 will be selected for the next drawing.\n\n\nIn Sheet2 Column B (SBLO) is where I want to place the number of drawings Skipped Between the Last Occurance for each number in Column A (#).\n\n\nThe Sheet2 example has the results I'm seeking in Column B (SBLO) according to the latest drawings in Sheet1.\n\n\n[IMPORTANT] I didn't template the full history of drawings in my Sheet1 example. The #4 on Sheet2 shows 47 skips between last occurance but to save space I didn't list the drawings that far back.\n\nEx. 2-6-11-13-31 was the last drawing on Sheet1 so they will have 0 skips between last occurance on Sheet2. The drawing before that on Sheet1 was 6-7-22-23-32. Numbers# 7, 22, 23, 32 on Sheet2 will have 1 skip between last occurance, 6 already has 0, etc. etc.\n\nLame attempt below. This is stuff I mashed together from my little subroutine library but it definitely has big holes in it. I'm far from being VBA proficient. I only know enough to be dangerous and always frustrated.\n\nThanks in advance to anyone willing to help.\n\n\n\n\n\n\n(Code, 15 lines)"
<https://forum.ozgrid.com/forum/index.php?thread/1229424-count-skips-between-last-occurrence/&postID=1247990>