Excel-text result of 2 text columns - excel-formula

I have 2 columns (A & B) with text. Column A has a variety of text values and blanks. Column B always has matching text values to those values in column A, except for some blank values in column A will have a new value in column B. Ex:
Column A
blue
blank
red
blank
column B
blue
blank
red
yellow
I would want column C to display (in order)
blue
blank
red
yellow
Can a formula be created for this?

a simple IF with AND:
=IF(AND(A1<>"",B1<>""),A1,A1&B1)

Related

Test for a cell not being formulaically populated vs one with data sourced from a different cell

I have a spreadsheet that auto-populates column B to equal the cells in column A. Column C will be the cell in column A, one row down, but if the cell in column A of the same row and column A of the next row are the same, it wil be column A of two rows down. Using this formula: =IF(A5=A6,A7,A6).
Right now, it prints data in one of the cells when they only contain the formula. I dont understand why.The right column below, which has 2 indigo,
is an example of the problem, with 'empty' where the cells are not populated, they have a blank pick list.
.. A ....... B.... . C
2 red .... red . orange
3 orange orange yellow
4 yellow yellow green
5 green green blue
6 blue.. blue... 0
7 empty . 0.... indigo
8 empty .. 0 ....indigo
9 indigo indigo violet
.
I don't mind the 0 being displayed, but the 3rd column up, right cell, is printing indigo, when it shouldn't be. The columns above that work fine.
NOTE: The cell in column C, violet, has a slightly different formula, if the
first cell matches the cell below, it sets it to the first data cell in column c, otherwise to the next cell in column A =if(a8=a9,a2,a9)
What I need to see to reduce the risk of human error, is have either a zero, or
nothing displayed in the cell which is showing the first indigo in column c.
Your formula is working correctly. The IF function evaluates a condition and returns either the True or False statement depending on the evaluation. Your condition is evaluating A5=A6 i.e. current cell equals cell above.
Row 9 Blue and Empty are not equal so you get 0 as this is what the empty cell A10 returns
Row 10 Empty and Empty are equal so A12 returned which is indigo
Row 11 Empty and Indigo are not equal so A12 returned which is indigo.
Instead change your test conditions to handle blank cells try:
Column B (To get rid of zeroes)
=IF(A5="","",A5)
Column C
Try variations on the following:
=IF(OR(A5="",A6=""), "", IF(A5=A6,A7,A6))
This part: OR(A5="",A6="") is handling all combinations of blank comparisons i.e. current cell is blank, cell above is blank, both are blank.
Switch these out with ISBLANK function for empty cells:
Column B
=IF(ISBLANK(A5),"",A5)
Column C
=IF(OR(ISBLANK(A5),ISBLANK(A6)), "", IF(A5=A6,A7,A6))
If you want to handle blank/empty cases differently then consider also using other logic operators e.g. AND operator in a test with AND(ISBLANK(A5),ISBLANK(A6)) if only where both blank, for example. In the above example, the OR operator will cover this because I was catering for any occurrence of a blank/empty in current or cell above.

Excel: If column A matches, add column B value horizontally in column C

Is it possible to match values from column A and if they match, add all matching values from column B to column C horizontally?
I've attached an example of the excel as image.

How to compare 2 columns in excel

I have Column A and Column B. What I want to do is copy Column C and remove rows which match/contain rows in Column B.
I have this formula but it doesn't remove containing rows, only matching:
=ARRAYFORMULA(IF(ISNA(MATCH(A:A,B:B,0)),A:A,""))
Any formula/query for this?
You can see it live here (please comment suggestion there): https://docs.google.com/spreadsheets/d/1EBJgRAt0UfyfP_zgv3RITNnN3VW3KXoeiIC9mDTjJL4/edit?usp=sharing
If you set the formula in column c row 1 as "=if(a1 = b1,1,0)", then you could just filter on values in column c = 1 and delete those rows. That way when you copy column c to another column or where ever else you are copying the data, you will not get the matching items to copy over.
Excel - Copy column A to C - Highlight columns B & C - Home - Conditional Formatting - Highlight Cells Rules - Duplicate Values - Light Red Fill with Dark Red Text - Sort on pink cell colors for column C - Delete values shaded pink in column C - Done

Count of values based on preceding rows

Some hundreds of rows of column A is filled in random order with color names (white, blue, green, yellow, red).
I need a formula in column B to show how many rows are BEFORE that row that contains the same color (standing in column A).
Example:
A B
white 0
yellow 0
yellow 1
green 0
white 1
yellow 2
Formula:
=COUNTIF($A$1:$A1,$A1)
Place the formula in cell B1 and fill down.
you need to move your data in column A one row down and then put this formula in B2, like this:
=COUNTIF($A$1:$A1,$A2)
And then copy and fill down the formula.

Change background color of the row or range if a particular cell value is equal to some text

What I have:
1 Col A Col B Col C Col D Col E Col F
2
3 Approved Text Text Text Text Text
4 Reject Text Text Text Text Text
5 Pending Text Text Text Text Text
What I want is :
If Column A value is equal to Approved then entire row-3 should have a green background.
If Column A value is equal to Reject then entire row-4 should have a red background.
If Column A value is equal to Pending then entire row-5 should have a amber background.
How to change the background color of the row or range if a particular cell value is equal to some text?
Based on Excel 2007:
Ie in Conditional Formatting create three separate rules, each with a formula like =$A1="Approved" and formatting to suit and with Applies to: a sensible maximum for the range to be formatted.

Resources