Hi,
I would like to had a sheet auto populated with values form another sheet based on a column vlaue.
This is an example of what I would like to achieve:
SHEET1
A B C D E 1 abc Server1 def Y 123 2 ghi Server3 jkl N 456 3 mno PC2 opq Y 789 4 rst PC5 uvw Y 012 5 cba Server4 fed N 345
SHEET2
A
1 Server1X
2 Server2X
3 PC5X
Sheet 2 should be populated with values from column "B" of sheet1 (and append "X"), if column "D" is = "Y", otherwise ignore and do not add to sheet2.
I was looking at VLOOKUP, but I don't think that it will work... then again, I'm not that good with formulas.
there are more columns and rows, and the data is different... just an example.
can you help? Please no VBA code, only formulas.
Thank you
Last edited by NBVC; 02-09-2012 at 04:37 PM.
Assuming your data is in Sheet1, starting at A1, then in Sheet2 enter formula:
confirmed with CTRL+SHIFT+ENTER not just ENTER and copy down as far as needed.=LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX(Sheet1!$B$1:$B$5,SMALL(IF(Sheet1!$D$1:$D$5="Y",ROW(Sheet1!$D$1:$D$5)-ROW(Sheet1!$D$1)+1),ROWS($A$2:$A2)))&"X"))
Adjust ranges to suit, and reconfirm with CSE keys before copying down again.
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Try this in A1, sheet 2:
Confirmed with Ctrl-Shift-Enter rather than Enter only.=INDEX(Sheet1!$B$1:$B$5,SMALL(IF(Sheet1!$D$1:$D$5="Y",ROW(INDIRECT("1:"&ROWS($D$1:$D$5))),""),ROW(A1)))&"X"
Copy down till getting error sign.
Click the star icon in left-corner of my post if you find my post userful!
Quang PT
quangphanidico@yahoo.com
PM me: Y!M: quangphanidico
most excellent. I just notice that you uploaded the excel file... Thank you!
I need to add one more item:
Instead of adding "X", how can I append the value of the corresponding cell from column "E" of sheet1?
SHEET2
A
1 Server1123
2 Server2789
3 PC5012
thanks
Try:
confirmed with CTRL+SHIFT+ENTER=LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX(Sheet1!$B$1:$B$5,SMALL(IF(Sheet1!$D$1:$D$5="Y",ROW(Sheet1!$D$1:$D$5)-ROW(Sheet1!$D$1)+1),ROWS($A$2:$A2)))&INDEX(Sheet1!$E$1:$E$5,SMALL(IF(Sheet1!$D$1:$D$5="Y",ROW(Sheet1!$D$1:$D$5)-ROW(Sheet1!$D$1)+1),ROWS($A$2:$A2)))))
note that you have an extra space in column B entries, that will appear in the results..
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
@NVBC,
Is it needed to combine the two INDEX?
Concanating two ranges together:
=LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX(Sheet1!$B$1:$B$5&Sheet1!$E$1:$E$5,SMALL(IF(Sheet1!$D$1:$D$5="Y",ROW(Sheet1!$D$1:$D$5)-ROW(Sheet1!$D$1)+1),ROWS($A$2:$A2)))))
keep the formula much shorter!![]()
Click the star icon in left-corner of my post if you find my post userful!
Quang PT
quangphanidico@yahoo.com
PM me: Y!M: quangphanidico
Yes, good point. That would be better.
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
geniuses. thank you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks