Excel conditional formatting - excel

I was hoping someone can help me with a formula.
What I am trying to do is format a number as currency if the column 3 to its left contains a specific text.
For example,
Col1, Col2, Col3
YES a 5$
NO b 4
YES c 3$
In this case 5 and 4 are formatted as currency since their corresponding Col1 is YES.

Use:
=$A1="YES"
As the formula and apply it to Column C

Related

Compare cell values in same column with other conditions in Excel

In below table in Excel, there are multiple columns, attaching 3 column just as an example. There are duplicates in ID column. Col1 has yes/no values.
I want to create a new column which will display Yes in case any value in Col1 is Yes for a particular ID.
E.g. if ID=1, if it contains at least one "yes" value in col1, then new_col should display yes.
If for an ID=3, all No, then new_col=No. I want to build an Excel formula. Please help.
ID Col1 New_Col
1 Yes Yes
1 No Yes
2 Yes Yes
3 No No
3 No No
3 No No
4 No No
Use:
=IF(COUNTIFS(A:A,A2,B:B,"Yes"),"Yes","No")

How do we split the columns in excet sheet into two columns based on the data present in the column?

I have data in one column i.e., Purchases as
Purchases
2 Pens
3 Books
4 Pens
1 Gifts
2 Books
I want to split it as
Col1 Col2 Col3
2Pens 3Books 1Gift
4Pens 2Books
In Excel O365, you could use in C1:
=FILTER($A1:$A5,ISNUMBER(SEARCH("* "&INDEX(UNIQUE(MID($A1:$A5,FIND(" ",$A1:$A5)+1,LEN($A1:$A5))),COLUMN(A1)),$A1:$A5)))
Drag the formula right.

excel multiple column vlookup

My table
Id index Col1 col2 col3
a 1 smith
a 2 John
b 1 mark
b 2 kay
b 3 Van
c 1 Par
c 2 Cap
In the Vlookup Table
ID Col1 Col2 Col3
a Smith John
b Mark kay Van
c Par Cap
How do I achieve by doing vlookup by id
I believe this will solve your issue:
This is the formula in cell I2:
=INDEX($C:$C,MATCH($H2,$A:$A,0))
This is the formula in cell J2:
=IF(INDEX($D:$D,MATCH($H2,$A:$A,0))=0,OFFSET(INDEX($D:$D,MATCH($H2,$A:$A,0)),1,0))
This is the formula in cell K2:
=IF(INDEX($E:$E,MATCH($H2,$A:$A,0))=0,OFFSET(INDEX($E:$E,MATCH($H2,$A:$A,0)),2,0))
Hope this helps!
Thanks.
If you want to use vlookup instead of index and match, you could use a helper column:
The formula in cell 1 is:
=B2&C2
The formula in cell H2 is:
=IF(ISERROR(VLOOKUP($H2&RIGHT(I$1,1),$A$2:$C$8,RIGHT(I$1,1),0)),0,VLOOKUP($H2&RIGHT(I$1,1),$A$1:$F$8,RIGHT(I$1,1)+3,0))
To make the formula be the same in all cells in the output table, I have used the rightmost character in the column name as an index. Hard coding this value, or adding a helper row, would make it easier to read.

How to fill in a cell with text based on a value

I want to fill in one cell with text based on another cell that has a number. So for example if A1 reads 2 I want B1 to read Correct.
In my case I have multiple possible criteria, B1 = Correct is just ONE example.
Will this be a conditional format formula involving an IF function or vlookup possibly?
Basically what I'm looking to do is IF A1 = 2, than B1 = Text
Thanks in advance for an answer to this
Use a VLOOKUP formula
to do this you need a table of key and value
for example
in the range d1:E6 you have the lookup table.
Lookup LookupValue
1 May be correct
2 Don't know
3 It depends
4 probably correct
5 My wife says it is correct
In the range a1:c7 you have your data
col1 col2 col3
kjkjk 2 Don't know
klkl 2 Don't know
jkljkjk 1 May be correct
kjukjkjk 4 probably correct
lklklkl 5 My wife says it is correct
lklklkl 3 It depends
in col3 you use the VLOOKUP
as =VLOOKUP(B2, MyLookupTable, 2)
Note that I named the d1:e6 range as MyLookupTable
THis is what it looks like

How to get sub ranges from pivot table

I have a table like this
col1 col2
a 1
a 2
a 3
a 4
a 5
b 6
b 7
b 8
b 9
b 10
I want to write a PERCENTILE function for each group in col1. Is there a way by pivoting this table and writing custom function PERCENTILE. But calculated field in pivot table is not allowing to write functions. I have to do this without VBA
I have to write, to find average of top 70%, something like below. But how to get sub ranges?
col1 col2
a =AVERAGEIF(B1:B5,">"&Percentile(B1:B5,0.7))
b =AVERAGEIF(B6:B10,">"&Percentile(B6:B10,0.7))
You could do that with an array formula since the percentile function accepts arrays:
=PERCENTILE(IF($A$2:$A$11=D2,$B$2:$B$11,""),0.7)
This needs to be entered as an array formula with ctrl+shift+enter.
{=PERCENTILE(IF($A$2:$A$11=D2,$B$2:$B$11,""),0.7)}
Just auto-fill that down the column. Let me know if you need an example of how to copy-paste the unique values of a column.
You can test it like so if you want. It works:
=PERCENTILE(B7:B11,0.7)
Good Luck.

Resources