Alternative to the V-LOOKUP? | Fairly simple table problem (PART 2)

James12513

New Member
Joined
Jul 24, 2014
Messages
27
Hello all,

I am trying to match each city to whether it rained or not. I can't seem to find a function that will allow me to do that - I've tried the V-Lookup and Index-Match functions but have had no luck...

Andrew posted a very nice formula which populates the 'cities visited' cells in table 2 below: =REPT("Y",COUNTIFS($G$2:$G$6,$K2,$H$2:$H$6,L$1)>0)

Does anyone know a formula that would populate each rain column in table 2?

Any ideas would be fantastic :)

Data table1:

Country ID
Cities visited
Rain?
H240LondonY
H240New YorkN
G456TokyoY
H240SydneyN
W869FloridaN

<tbody>
</tbody>


Presentation table 2:

Country ID
London
Rain?
New York
Rain?
Tokyo
Rain?
Sydney
Rain?
Florida
Rain?
W869YN
G456YY
H240YYYNYN

<tbody>
</tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
<b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B10</th><td style="text-align:left">{=MID(<font color="Blue">IFERROR(<font color="Red">INDEX(<font color="Green">"Y"&$C$2:$C$6,MATCH(<font color="Purple">$A10&OFFSET(<font color="Teal">$B$9,0,INT(<font color="#FF00FF">(<font color="Navy">COLUMNS(<font color="Blue">$B9:B9</font>)-1</font>)/2</font>)*2</font>),$A$2:$A$6&$B$2:$B$6,0</font>)</font>),""</font>),MOD(<font color="Red">COLUMNS(<font color="Green">$B9:B9</font>)-1,2</font>)+1,1</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.</td></tr></table><br />





Excel 2013
ABCDEFGHIJK
1Country IDCities visitedRain?
2H240LondonY
3H240New YorkN
4G456TokyoY
5H240SydneyN
6W869FloridaN
7
8
9Country IDLondonRain?New YorkRain?TokyoRain?SydneyRain?FloridaRain?
10W869YN
11G456YY
12H240YYYNYN
Sheet1
 
Upvote 0
VBA Geek that is amazing, works a treat! thank you! :biggrin:

I don't know if it's too much to ask but would it be possible to give an explanation as to how exactly the formula is doing this beautiful magic?
 
Upvote 0
Just to double check, is it correct that I have entered it into cell B10 and just dragged across and down?

Otherwise I have just done this for each column:
(Both ways seem to work? )

B10: =MID(IFERROR(INDEX("Y"&$C$2:$C$6,MATCH($A10&OFFSET($B$9,0,INT((COLUMNS($B9:B9)-1)/2)*2),$A$2:$A$6&$B$2:$B$6,0)),""),MOD(COLUMNS($B9:B9)-1,2)+1,1)

C10: =MID(IFERROR(INDEX("Y"&$C$2:$C$6,MATCH($A10&OFFSET($B$9,0,INT((COLUMNS($B9:C9)-1)/2)*2),$A$2:$A$6&$B$2:$B$6,0)),""),MOD(COLUMNS($B9:C9)-1,2)+1,1)

A
B
C
9
Country ID
London
Rain?
10
W869
11
G456
12
H240
Y
Y

<tbody>
</tbody>
 
Last edited:
Upvote 0
Just to double check, is it correct that I have entered it into cell B10 and just dragged across and down?

Yes.

would it be possible to give an explanation as to how exactly the formula is doing this beautiful magic?

maybe you can tell me the parts that you do not understand and I answer you?
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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