Excel merge/Concat two dynamic ranges into a single range - excel

If I have the following dynamic lists, length determined by the last blank row.
range=A1:A5
AAA
BBB
CCC
<blank>
<blank>
and, range=B1:B3
111
222
<blank>
How can I create a new list/range that has the two ranges joined together without the blanks.
range=C1:C8
AAA
BBB
CCC
111
222
<blank>
<blank>
<blank>

This was the convoluted way I managed to get it to work, most likely there is something much more succinct
=IF(A1<>"",A1,INDEX($B$1:$B$8,ROW(C1)-ROW($C$1)-COUNTA($A$1:$A$8)+1))

Related

Excel formula to find specific data based on max row result

Good day beautiful people of Scotl... Stackoverflow.
I have faced issue in Excel which I have no idea how to solve. I tried many formulas but I believe that the problem is in my mind, since I have troubles to imagine the logical way it should follow.
I have attached a screenshot to clarify my problem:
Excel screenshot
Description of a screenshot
Column B - data name,
Rows C3:H3 - product name,
Table C4:H15 - some data (description, dates, etc.).
Column I is my extra and it is not mandatory to be there.
Desired result
I want to get data from table above to the table below but if there is one or more "DataX", I want Excel to pick the "DataX" where the biggest amount of rows are filled up (I have marked them blue for each DataX).
For example, for:
Data 1 - row 4,
Data 2 - row 7,
Data 3 - (obviously) row 9,
Data 4 - rows 11,
Data 5 - row 13.
If one or more records will match (all rows are empty / filled up), I don't care which row will be presented as a result.
What I have tried
I have added calculation (column I) which shows how many rows were updated and I was trying to find combination of v,hlookup + max but it wasn't working correctly.
I also created VBA code for it, which was working... almost good but then I received information that macros are no-go zone for this project.
Logic
I strongly believe that the logic should be as following:
Find matching DataX,
Find max value in row I (or include it in formula),
Find corresponding rows / columns for this record.
A
B
C
D
E
F
G
H
I
2
CAT 1
CAT 2
CAT 3
CAT 4
CAT 5
CAT 6
Count not blank
3
1
2
3
4
5
6
4
Data 1
AAA
BBB
CCC
EEE
FFF
=$H$3-COUNTBLANK(C4:H4)
5
Data 1
BBB
CCC
DDD
=$H$3-COUNTBLANK(C5:H5)
6
Data 1
AAA
BBB
EEE
FFF
=$H$3-COUNTBLANK(C6:H6)
7
Data 2
AAA
BBB
CCC
DDD
EEE
FFF
=$H$3-COUNTBLANK(C7:H7)
8
Data 2
AAA
BBB
CCC
DDD
FFF
=$H$3-COUNTBLANK(C8:H8)
9
Data 3
AAA
BBB
CCC
EEE
FFF
=$H$3-COUNTBLANK(C9:H9)
10
Data 4
CCC
DDD
EEE
FFF
=$H$3-COUNTBLANK(C10:H10)
11
Data 4
AAA
BBB
CCC
DDD
FFF
=$H$3-COUNTBLANK(C11:H11)
12
Data 4
AAA
BBB
CCC
EEE
FFF
=$H$3-COUNTBLANK(C12:H12)
13
Data 5
AAA
BBB
CCC
DDD
EEE
FFF
=$H$3-COUNTBLANK(C13:H13)
14
Data 5
BBB
CCC
DDD
EEE
FFF
=$H$3-COUNTBLANK(C14:H14)
15
Data 5
AAA
BBB
DDD
EEE
FFF
=$H$3-COUNTBLANK(C15:H15)
Hello dear son of Scotl.. overflow!
Please add to column J (range J4:J15) this additional formula
=CONCATENATE(B4,I4)
and then paste this to C19:
=INDEX(C$4:C$15,MATCH(CONCATENATE($B19,MAX(IF($B$4:$B$15=$B19,$I$4:$I$15,0))), $J$4:$J$15,0))
paste it as an array formula, i.e. press Ctrl+Shift+Enter simultaneously. Then populate it to the rest of the desired range.
The numbers in my example table do not mean anything, it's the number in I that matters.
Regards!!

Replacing a value after comparing 2 columns from VLOOKUP

I have to compare SYSIDs in 2 excel sheets and replace SYSID in first sheet with Component ID in 2nd sheet.
First sheet: Second Sheet:
SYSIDS SYSIDS COMPONENT_ID
123 123 111
345 345 222
678 678 333
First sheet Output should be:
SYSIDs:
111
222
333
How can I get it done?
Simple VLOOKUP:
=VLOOKUP(A2,Sheet2!A:B,2,FALSE)

Excel : Getting first values out of a table

(First of all, sorry that the pictures are linked and not displayed, but I still don't have 10 reputation to do so :'( )
Hello everyone !
I'm in need of your advices and answers : Despite searching through the Internet, I couldn't find anything for my problem. So, I'm coming here, in hope that you all can enlight me.
I'm having a data table looking something like this : (This is an example)
For copy / paste:
Name Index Val 1 Val 2 Val 3
AAA 1 121 12 81921
BBB 2 651 9491 1
CCC 3 11 90121 210
DDD 4 612 18 29
EEE 5 1441 12 123
FFF 6 12 1921 51
GGG 7 210 120 1245
… … … … …
I'm looking for formulas that will allow me to get the 5 highest values of a specific type, then display it in the following formant : (Another example handmade)
Which will look like this :
Name Val 1 Name Val 2 Name Val 3
EEE 1441 CCC 90121 AAA 81921
BBB 651 BBB 9491 GGG 1245
DDD 612 FFF 1921 CCC 210
GGG 210 GGG 120 EEE 123
AAA 121 DDD 18 FFF 51
In each different newly-created table, I should have the 5 highest datas of a given value.
Ideally, these new tables should be automatically updated when new datas are entered in the main table, so that there is no need to recheck everything.
Thanks a lot for your future answers ! If you need answers to better understand my problem and what I'd need, I'll love to answer you !
After creating appropriate column header labels, put these two formulas in G2:H2.
=INDEX($A:$A, AGGREGATE(15, 7, ROW($B$2:INDEX($B:$B, MATCH(1E+99, $B:$B)))/(INDEX($A:$E, 2, MATCH(H$1, $A$1:$E$1, 0)):INDEX($A:$E, MATCH(1E+99, $B:$B), MATCH(H$1, $A$1:$E$1, 0))=H2), COUNTIF(H$2:H2, H2)))
=AGGREGATE(14, 7, INDEX($A:$E, 2, MATCH(H$1, $A$1:$E$1, 0)):INDEX($A:$E, MATCH(1E+99, $B:$B), MATCH(H$1, $A$1:$E$1, 0)), ROW(1:1))
Fill down four additional rows then copy G2:H6 to J2:K6 and M2:N6.

Get last unique row in Excel

I'm having a table looking like this:
id1 | id2 | dateUpdate
==========================================
aaa | 111 | 2016-01-01
aaa | 111 | 2016-01-02
aaa | 222 | 2016-01-05
aaa | 222 | 2016-01-15
bbb | 333 | 2016-01-05
bbb | 444 | 2016-01-01
ccc | 111 | 2016-01-02
I'd like to get only the latest row for each id1/id2 couple:
id1 | id2 | dateUpdate
==========================================
aaa | 111 | 2016-01-02
aaa | 222 | 2016-01-15
bbb | 333 | 2016-01-05
bbb | 444 | 2016-01-01
ccc | 111 | 2016-01-02
Thanks for your help!
Use Aggregate Function
=AGGREGATE(14, 6, 1/($A$2:$A$99=E2)*($B$2:$B$99=F2)*($C$2:$C$99), 1)
You have to put the unique combinations in column E2 and Column F2 downwards
You have five unique combinations
COLUMN A COLUMN B
aaa 111
aaa 222
bbb 333
bbb 444
ccc 111
And Aggregate Funtion is to be put in column G2 and fill down downwards.
=AGGREGATE(14, 6, 1/($A$2:$A$99=E2)*($B$2:$B$99=F2)*($C$2:$C$99), 1)
Regarding Syntax 14 is for Large value that is the for example larger for first aaa 111 combination that is #02-01-2016#
Next digit 6 in formula is for ignoring errors
You can quickly get the pseudo-Last value using the AGGREGATE function..
This is a standard non-array formula that does NOT require Ctrl+Shift+Enter. AGGREGATE was introduced with Excel 2010.
($A$2:$A$99=E2) checks which value of column A matches with the first unique value of column A of unique combination of A & B
This is converted to an array of logical values which gives an array of True Or False. Dividing 1 by these logical values give either 1 or DIV# error. Similar process is adopted for Column B values mentioned in column F. I have taken data limited to 99 rows. If it more number of rows you change the figure of 99 to a higher figure as per your requirements.
HTH
EDIT
You can also go for pivot table solution as suggested by #Tim Biegeleisen in his comments. Snapshot given here-under illustrates that approach.
id1 and id2 are taken as filter fields and Maximum Value of dateUpdate is chosen in the value field.

Delete entire row if Consequent Data is Matching in Excel 2007

I have a problem is if my columns Consequent Data is Matching then it should Delete row.
for e.g.
Before
column A column B
aaa 10
aaa 10
aaa 5
bbb 6
aaa 10
bbb 5
After
column A column B
aaa 10
aaa 5
bbb 6
bbb 5
Select all the data in column a and b and then on the data ribbon select remove duplicates.

Resources