How to Stack a range of values (from multiple tables in another sheet) into a single column - vba

I'm working on a quarterly report that Auto-generates all fields.
I could really use some help building a formula that pulls values from the first column ([T6-TOC]) of three separate tables (ROVH_Jan, ROVH_Feb, ROVH_MAR) existing in another worksheet (RVH 1825). I need the three ranges of values to stack in a single column, but I do not want to eliminate duplicates values.
I've tried using =INDEX formula, and VBA but I can't get the syntax right.
Any suggestions?
These are sources I've viewed but didn't solve my problem.
https://superuser.com/questions/445410/pull-row-of-data-from-one-place-in-spreadsheet-to-another
http://forum.chandoo.org/threads/merge-stack-multiple-named-ranges-across-multiple-worksheets-in-a-master-sheet.11074/
Excel - Combine multiple columns into one column
http://www.mrexcel.com/forum/excel-questions/610527-how-do-i-stack-data-multiple-columns-into-one-column.html

Something like this should work for you:
=IF(ROW(A1)<=ROWS(ROVH_Jan),INDEX(ROVH_Jan[T6-TOC],ROW(A1)),IF(ROW(A1)<=ROWS(ROVH_Jan)+ROWS(ROVH_Feb),INDEX(ROVH_Feb[T6-TOC],ROW(A1)-ROWS(ROVH_Jan)),IF(ROW(A1)<=ROWS(ROVH_Jan)+ROWS(ROVH_Feb)+ROWS(ROVH_MAR),INDEX(ROVH_MAR[T6-TOC],ROW(A1)-ROWS(ROVH_Jan)-ROWS(ROVH_Feb)),"")))

Related

VBA duplicate issue

I am really stucked and I do not know how to make it possible regarding coding in VBA or any coding language. I have to do something for my workplace. I have list in the Column A in my excel sheet. I have different values in it but sometimes I have the same value in different cells in the same column. I cannot remove the duplicates because those same values are a contract-id. In the 9th column I have the total sum of the value of the contract. So it is about automatization of invoices with the help of vba.
I need to add the same values together with the total sum into a different sheet.
Let's say it looks that:
omni345 54€
omni334 2€
omni345 23€
I need to put the omni345's into one single invoice pdf. I do not know how to put them together. Furthermore I need to place those 2 same values in the invoice like this which is in a different sheet:
omni345 54€
omni345 23€
So that the client clearly can see that there are x different contracts.
What I need is the right direction how to start it.

Conditional formatting comparing two adjacent columns for every other column

It's easy to do conditional formatting that compares 2 columns, e.g.: =$A1=$B1. But what if I also want to compare C and D, but NOT B and C? Ideally, I'd like to do this with a single conditional formatting formula since I have many columns, but I'll settle for VBA if necessary (I'm just unfamiliar with conditional formatting in VBA).
NOTE: I've tried some variations of =AND(MOD(COLUMN(),2),A1=B1), but that hasn't worked.
NOTE 2: Here's some more specifics: Basically I'm comparing data in two nearly identical tables, and I want to highlight any differences. So for example, each table has a "Study_ID" column, and I want to view those side by side on a new sheet, e.g. in Columns A and B, highlighting unmatched cells in both columns. It would be easy to say =$A1:$B1 and apply to =$A$A:$B$B. But I'm also viewing "Name" side by side, e.g. in Columns C and D. I could add a new formula =$C1:$D1. But since the source tables have like 20 columns, that would require like 20+ formulas. I'd prefer one.
Thanks!
The image below was accomplished using multiple formulas (=$A1<>$B1, applied to =$A$1:$B$4, and =$C1<>$D1, applied to =$C$1:$D$4)
Edit: Figured out a single formula that will do it:
=A2<>OFFSET(A2,,IF(MOD(COLUMN(),2)=1,1,-1))

VBA - How to find frequencies of "x" and "y" in a list

I have a column of names on one page of an excel workbook, I need to find how often each of these names appears in that column and display it on another sheet. For example, the code needs to count "CS" however many times it appears in this column and display it on a separate sheet, then the same with "Grad" and so on. Any tips?
Thanks a lot
That's the primary use of Pivot tables.
Found the solution with a simple function
=COUNTIF(Individual_Stats!D6:D999,"CS")

Build a Column by applying a formula to an existing column (like in excel)

I am new to the community. Hopefully this was not answered already.
I am trying to add a column to a DataFrame that contains a formula based on the previous columns. Example, build a series of stocks returns based on stocks close.
I know how to build a column by doing exactly the same thing to all elements of another, but not to use a columns element and formula to create another.
Thanks for your help.

SQL query in excel returning one value uses two rows or columns?

I'm running a query from excel to sql server that returns a single value. It seems as if this uses two cells in excel. Is this correct? Is there a way to prevent this? Is there a way to predict whether excel will use an extra row or an extra column (I've seen both happening)?
If, in excel, I use "import external data -> new database query", and then do a count() on an sql server table, excel usually puts the result in the cell underneath the cell which I had selected when starting to do the new query (not adding an extra row, but putting the value there). Sometimes, it will instead insert an extra column before the column of the cell I had selected and put the result in the new column in the same row as the cell I had selected.
Is there a way to have excel return the value in the same cell as the one selected when starting the query? If not, is there a way to predict which of the two scenarios above will happen?
Thanks,
Ernst
I finally found the answer:
uncheck preserve column sort/filter/layout