VLOOUP and INDEX I think?!

NJS1982

Board Regular
Joined
Sep 24, 2009
Messages
183
Office Version
  1. 365
Platform
  1. Windows
Hi all, been a while! I'm creating another spreadsheet and wondered if anyone can help me out with it.

I have a survey that asks a question, with responses to the question being:
- Definitely
- Likely
- Not Sure
- Unlikely
- Definitely Not
- N/A

The downloaded sheet displays the answers in six columns; if the respondent selects 'Definitely' for example, 'Definitely' is populated in column A, with columns B, C, D E and F being blank. If they select 'Not Sure', columns A and B are blank, C contains 'Not Sure' and D, E and F are also blank. And so on....

Each line of the sheet is from one individual, whereby they are given a Unique Reference Number (a URN).

I am trying to pull together all responses, so on another tab (tab A) I have all of the URNs and am using VLOOKUP to extract individual responses.
I want tab A to have a column asking something like 'What was the response to question 10', for this cell to display which of the six responses listed above.

I believe I have to INDEX it somehow but can't work it out; can anyone please help?!?

Respondent:DefinitelyLikelyNot SureUnlikelyDefinitely NotN/A
URN 1Definitely
URN 2Not Sure
URN 3Unlikely
URN 4Definitely
URN 5Likely

<tbody>
</tbody>

SO, hopefully that makes sense. I am wanting a formula to tell me:

"What is the response to URN 1, for question 1"
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi, can't you just post sample tables directly in thread like you did in the first post?
Thanks, but less simple tables. I'll give it a go though!! Thanks for your perseverance here!
 
Upvote 0
OK, here goes. So this is the first summary tab (a simplified version of it anyway), with the required formula being required in the blank cell:

URNQ13: Will you capture INCOME GENERATED?
12345
23456
34567
45678
56789
67890
78901
89012
90123

<tbody>
</tbody>

Then the source data sheet, where I am dumping all of the data, looks like this (again, simplified):

URNIncome generated - DefinitelyIncome generated - LikelyIncome generated - Not SureIncome generated - UnlikelyIncome generated - Definitely NotIncome generated - N/A
67890Definitely
56789Definitely Not
90123Not sure
45678N/A
89012Likely
34567Definitely
78901Likely
12345Not sure
23456Definitely

<tbody>
</tbody>

So, the response to the question how likely is respondent 34567 to collect information on income generation, I want to display (in the first table) the response 'Definitely'.
78901 would be 'Likely', 12345 would be 'Not sure' and so on...
 
Last edited:
Upvote 0
Tried Dropbox but don't think it works.
Excel online only shares to people in my work network.
Argh!

trusted cloud services that don't require registration for those assisting is the preferred way if necessary
 
Upvote 0
Hi, sorry - got busy all of a sudden!

You can try this. Note that the text in cell B1 and C1 etc needs to partially match the text in row 1 of the data source sheet. i.e. can't include Q13 - and the other preamble.


Excel 2013/2016
ABC
1URNINCOME GENERATEDanother question
212345Not surelikely
323456DefinitelyDefinitely Not
434567Definitelynot sure
545678N/ADefinitely
656789Definitely Notnot sure
767890Definitelylikely
878901Likelylikely
989012Likelyn/a
1090123Not sureunlikey
Sheet1
Cell Formulas
RangeFormula
B2=LOOKUP(2,1/(ISNUMBER(SEARCH(B$1,Sheet2!$B$1:$L$1))*(INDEX(Sheet2!$B:$L,MATCH($A2,Sheet2!$A:$A,0),0)<>"")),INDEX(Sheet2!$B:$L,MATCH($A2,Sheet2!$A:$A,0),0))



Excel 2013/2016
ABCDEFGHIJKLMN
1URNIncome generated - DefinitelyIncome generated - LikelyIncome generated - Not SureIncome generated - UnlikelyIncome generated - Definitely NotIncome generated - N/Aanother question - Definitelyanother question - Likelyanother question - Not Sureanother question - Unlikelyanother question - Definitely Notanother question - N/A
267890Definitelylikely
356789Definitely Notnot sure
490123Not sureunlikey
545678N/ADefinitely
689012Likelyn/a
734567Definitelynot sure
878901Likelylikely
912345Not surelikely
1023456DefinitelyDefinitely Not
Sheet2
 
Upvote 0
Wow, that kind of works, for some!! Impressive. I have copied across to the other questions too.

I am however getting some errors on just some lines, which is odd. For example, I have URN 2017004414 that is returning #N/A# across all cells.
The actual response is 'Not Likely' so the initial two cells (Definitely and Likely) are blank.

The full formula I am using is this:
=LOOKUP(2,1/(ISNUMBER(SEARCH($P$1,'Survey Monkey Data'!$A$2:$CL$2))*(INDEX('Survey Monkey Data'!$A:$CL,MATCH(A21,'Survey Monkey Data'!$A:$A,0),0)<>"")),INDEX('Survey Monkey Data'!$A:$CL,MATCH(A21,'Survey Monkey Data'!$A:$A,0),0))

Cell P1 takes into account your point about the question; it contains a cell that simple says Income generated* with that wildcard to allow for the different scenarios, I think.
 
Upvote 0
I have URN 2017004414 that is returning #N/A# across all cells.

Try a simple formula to test if the URN numbers really matches between the two sheets - change the cells to the ones that contain the URN 2017004414.

=A21='Survey Monkey Data'!A1

Does the formula return TRUE?

says Income generated* with that wildcard to allow for the different scenarios


FWIW - you don't need to include a wildcard character - it won't hurt though and is not the problem.
 
Upvote 0
Hi, A21='Survey Monkey Data'!A21 is returning TRUE, yes.

The URN is matching for definite on the Survey Monkey sheet, because I have a whole host of other columns with more simpler VLOOKUP formulas that work fine, so not a missing URN / additional space / number formatting issue I don't think?
 
Upvote 0
No, ignore me, sorry! Just realised that I had mis-entered the URN to the one below, so when I was cross-checking the responses, they were not the same.
Turns out the URN I referred to actually has no response to that section (it is possible, by design, to by-pass this question) hence the error!
I'll fix with an ISERROR formula somewhere.
Many, many thanks for you help, massively appreciated!! :)
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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