Formula to return nth cell in a sequence with criteria

graemestown

New Member
Joined
May 10, 2019
Messages
16
Office Version
  1. 365
Platform
  1. Windows
https://www.dropbox.com/s/amwx4p2ofoau8w3/Example.xlsx?dl=0

1ABCDEFGHIJKLMNOPQRSTU
2WeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeekWeek
312345678910111213141516171819
4Bread 969883638494112750683986273390993566465127=Formula
5Cake 3205083068331003615336432384487311357596341566557=Formula
6Pies 32072048057420360754900796807774=Formula
7Rolls 602404801340977767583933731285335833462858872360932=Formula
8Donuts121620239212171752310518026398923138470516460518266=Formula
Criteria for formula:
1Ignores blank cells and allows for an 'if greater than' statement. For example it ignores all the bold cells because they are less than 50
2Then counts 8 cells from the start of the valid sequence
3Formula returns the value in the 8th cell, the result I want returned is italic & underlined
4Formula would be in column u which I could drag down and would work regardless of where the sequence starts

<colgroup><col width="64" style="width:48pt"> <col width="64" span="20" style="width:48pt"> <col width="64" style="width:48pt"> </colgroup><tbody>
</tbody>

<colgroup><col width="64" span="20" style="width:48pt"></colgroup><tbody></tbody>
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I think your formula only looks at the greater than 50 criteria.
How would I add the 'if blank' so it looks at both possibilities (blank and >50)
 
Upvote 0
I think your formula only looks at the greater than 50 criteria.
How would I add the 'if blank' so it looks at both possibilities (blank and >50)

The blank cell is less than 50, it is not necessary to set the criteria
 
Upvote 0
You're welcome, let me know if you have any doubt.
 
Upvote 0
Hi Dante

Slightly different question this time. How do you look up a horizontal list into a vertical data table. Something to do with index and match, I just can't get it working.
The simple example looks like this.

I have a column with a list A,B,C,D,E,F,G with sales values against them
ListSales
A12
B15
C17
D9
E21
F34
G45

<colgroup><col><col></colgroup><tbody>
</tbody>

I then have the same list A,B,C,D,E,F,G running horizontally. How do I do a lookup from the horizontal list below into the vertical list above. So A would return 12 etc...
The answer/formula needs to be in the row above the list.

Answer1215179213445
ListABCDEFG

<colgroup><col><col span="6"><col></colgroup><tbody>
</tbody>

Thanks!
 
Upvote 0
Try this

<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:28.51px;" /><col style="width:39.92px;" /><col style="width:74.14px;" /><col style="width:52.28px;" /><col style="width:29.47px;" /><col style="width:29.47px;" /><col style="width:29.47px;" /><col style="width:20.91px;" /><col style="width:29.47px;" /><col style="width:29.47px;" /><col style="width:29.47px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td><td >H</td><td >I</td><td >J</td><td >K</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">List</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">Sales</td><td > </td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">Answer</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">12</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">15</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">17</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">9</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">21</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">34</td><td style="background-color:#fafafa; color:#333333; font-weight:bold; font-style:italic; font-family:Verdana; font-size:9pt; text-align:right; ">45</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">A</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">12</td><td > </td><td >List</td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">B</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">15</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">C</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">17</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">D</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">9</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">E</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">21</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">F</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">34</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; ">G</td><td style="background-color:#fafafa; color:#333333; font-family:Verdana; font-size:9pt; text-align:right; ">45</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formul</td></tr><tr><td >E1</td><td >=VLOOKUP(E2,$A$1:$B$8,2,0)</td></tr></table></td></tr></table>
 
Upvote 0
Thanks, that was easy, I thought it was more complicated.
I didn't even try the v-lookup option, didn't think it would work like that.
Cheers!
 
Upvote 0
You're welcome.
Sometimes the easiest ones go away.:cool:
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,822
Members
449,340
Latest member
hpm23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top