getting new value if the reference value has a blank cell in next column

sarad agarwal

New Member
Joined
Mar 14, 2016
Messages
20
Hi All,

I have data in this format:
AuditorLocale_DE
Apple
AppleYes
Apple
Orange
Orange
Orange
GrapeYes
Grape
Grape

What formula will give me this result?
AuditorLocale_DERequired Value
Apple
AppleYes
Apple
Orange Orange_Locale_DE
Orange Orange_Locale_DE
Orange Orange_Locale_DE
GrapeYes
Grape
Grape

I.e if all the cells for orange is blank in column b then result in column c should give me the concatenated value of the column a and the header of column b.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
How about:

C2: =IF(COUNTIFS($A$2:$A$10,A2,$B$2:$B$10,"<>")=0,A2&"_"&$B$1,"")
 
Upvote 0
Thank you so much Eric. It worked like wonders.

Can you also help me in understanding the way this formula is working ?
 
Upvote 0
Sure.

In C2, the COUNTIFS counts how many times that A2 (Apple) appears in A2:A10, AND a non-blank cell appears in B2:B10. In this case it is 1 (row 3). The IF asks, is that zero? It is not, so it goes to the FALSE section of the IF, returning "".

In C5, the COUNTIFS counts how many times that A5 (Orange) appears in A2:A10, AND a non-blank cell appears in B2:B10. In this case it is 0. The IF asks, is that zero? Since it is, it goes to the TRUE section of the IF, returning A5 concatenated (the &) with an underscore and $B$1.
 
Upvote 0
Sure.

In C2, the COUNTIFS counts how many times that A2 (Apple) appears in A2:A10, AND a non-blank cell appears in B2:B10. In this case it is 1 (row 3). The IF asks, is that zero? It is not, so it goes to the FALSE section of the IF, returning "".

In C5, the COUNTIFS counts how many times that A5 (Orange) appears in A2:A10, AND a non-blank cell appears in B2:B10. In this case it is 0. The IF asks, is that zero? Since it is, it goes to the TRUE section of the IF, returning A5 concatenated (the &) with an underscore and $B$1.

Got it, Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top