Compare all cells in two rows between two ranges on the same worksheet - compare

New to SO.
I am am looking for a code to compare all the cells in two rows that belong to two different ranges on the same worksheet.
The two ranges (data sets) are one below the other.
The values in column A between the two ranges are common.
The number of rows within the ranges can vary.
I would like a code to loop theough the ranges and compare each row based on the value in Column A as a link and compare it to the respective row in the second data set.
If the values are different ,I would like to highlight the row in the Second set / range if they are different from the first range.
I would really appreciate if you can help me with suggestions on how I can go about doing this.

Related

How to sum two columns if one column might have two different variables which would call for a different calculation

I need to create a SUM() column (summing two columns), the issue I'm having in the second column might have a result which needs to multiply the first column or it might have a result which needs to be added to the result in the first column.
Example
First Column (Estimated Costs)
50,000
100,000
5,000
Second Column (contingency amounts)
5%
10,000
10%
5,000
The first column will always have numbers. The second column will either have a percentage or an amount. I need to create a formula to sum either possibility. Is this possible or do I need to create two different sum columns for either scenario?
I tried using an OR statement with the SUM() formula but it didn't seem to work.
I understand that you're providing the cotingency cost of the estimate on 2 different ways as a percentage of the estimate or as a lumpsum amount to be added to the estimate.
You should use IF() to differentiate the two operations you have to apply. As the two types of values are very different on the contingency column the #BigBen suggestion of Value>1 should work perfectly well as you won't be adding less than $1 buck as a contingency. Therefore the formula will be:
=IF(B1>1,A1+B1,A1*(1+B1))
Column A is Estimated Costs, Column B is Contingency.

OpenOffice Calc: Counting unique strings in cell range

I'm trying to find a way to calculate the number of unique strings in a single column, excluding blank cells. So far I've seen solutions such as the following:
=SUM(1/COUNTIF(X2:X99;X2:X99))
Plus another similar formula using FREQUENCY instead of COUNTIF. However, applying this to my spreadsheet gives me a decimal value that has no apparent meaning. For example, if my column contains 20 cells containing "ABC", and 30 cells with "XYZ", I should have an output value of 2. However, this is not the case, and even I can clearly see that the above formula won't output anything larger than a 1, which has left me rather confused as to its usage.
Pivot tables seem to show the most promise, but I can't get that to work either. Here's what I tried:
Select the column, including the header
Select a new pivot table and use the selected range
Drag the header from Available Fields to Row Fields
Select the ignore empty rows option
Create the table
This then creates a table with one row per unique entry in the first column, and an empty second column. One row below is a Total Result cell, with the adjacent cell empty.
From this, I can see that there must be some sort of capability of the software to find unique strings, so it would stand to reason that there must also be a way of counting them and displaying that value in a cell. The question is, how do I do that?
Your first attempt should work if (a) wrapped in SUMPRODUCT and (b) the range does not contain blank cells:
=SUMPRODUCT(1/COUNTIF(X2:X51;X2:X51))

In DataPrep, sum a set of many columns or values in an object

I have a DataPrep dataset which contains a series of ~10 columns, each of which indicates whether or not a particular brochure was selected:
BRO_AF BRO_SAF BRO_SE ...
1 1
1 1
1
I'd like to sum/count these values into a BrochuresSelected column.
I was hoping to use ADD with a column range (ie BRO_AF~BRO_ITA), but ADD only takes two numbers.
I can't use COUNT, as it counts rows not columns.
I can use NEST to create a column storing a map or array of brochures, but there doesn't seem to be a function for adding these. I can't use ARRAYLEN on this column, as even empty columns are represented in the column (eg ["1","","","","",""] would have an array length of six, not one).
Has anyone solved a similar issue?
If you know the column names, you can use the + operator in a derive transform. For example:

Same row different column. Excel Formula

If is possible with the if(indirect formula to give me the value from the same row but from a different column if a specific cell is from that row?
More specific: I want cell =Sheet2!F23 to give me =Sheet1!N11 if =sheet2!C23 is from Sheet1!B11.
The important thing is the I need it to come from row 11 but from a different column.
Thanks in advance.
I did the following:
On Sheet 1 i gave all the rows a unique number in column A
On sheet 2 i just put in the unique number(C23) and the rest of the cells on that row used the formula below with. The only thing i needed to change was the index of which column needed to be matched.
It might not be the most efficient way but i worked for me.
=IFERROR(INDEX(Sheet1!B:B;MATCH($C23;Sheet1!$A:$A;0));"")

Concatenating and wrapping on blank space

I am concatenating three rows of dates and the result looks like this 01/02/2014 02/03/2014 03/04/2014
Now after I want to stack them in one cell,
so they are stacked one below the other in one cell;
date 1
date 2
date 3
I greatly appreciate any help you may offer.
Thanks,
If you want three dates stacked one below the other, don't "concatenate" the dates in the three columns in the first place (that would mean turning three values in three columns into one long variable in one column). Use a proc transpose to convert three dates in three columns into three rows, one below the other.
The clearest tutorial I've seen on doing this is at: http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm