IF Function over Two Columns

skuddyb

New Member
Joined
Sep 29, 2015
Messages
39
Hi Guys,


Basically I have two columns which have been used to capture data.

col 1col 2col 3
x
x
x
x
x

<tbody>
</tbody>


I want to use an IF function ( I assume ) to collate my data into the third column to effectively see which rows have a mark against them.

Is anyone able to help me with this one?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi Guys,


Basically I have two columns which have been used to capture data.

col 1col 2col 3
x
x
x
x
x

<tbody>
</tbody>


I want to use an IF function ( I assume ) to collate my data into the third column to effectively see which rows have a mark against them.

Is anyone able to help me with this one?
Hi skuddyb, welcome to the boards.

I am afraid you will need to give us more information to get help on this. What data you are trying to collate into column 3 would be a great start. Based on your example data it is impossible to tell exactly what you are trying to achieve.
 
Upvote 0
Hi,

Cheers man. Sorry, basically I have a huge database going on, and x marks a responder. I have had to import column 2 from another work sheet although it's the same data in the same layout. So now I have two columns of "x's" but I only want one so I need to have a formula in Col 3 to effectively display what Col1 & Col2 show but combined.

The data itself is fairly irrelevant i'm pretty sure seeing that the only thing we need for this are the three columns?

Thanks for your help.
 
Upvote 0
This should get you started. It tests for anything in columns A & B (<> "") and returns which columns it finds something in.

=IF(AND(B3<>"",C3<>""),"Both A & B", IF(B3<>"", "Just A",IF(C3<>"","Just B", "Neither")))

A B C
x Just A
x Just B
x x Both A & B
Neither

If all you want is an X in C when there's one in A or B or both, it's much simpler:


=LEFT(B3 & C3,1)


A B C
x x
x x
x x x

The Forum messed up the spacing, but I'm sure you get the idea
 
Last edited:
Upvote 0
Hi,

Cheers man. Sorry, basically I have a huge database going on, and x marks a responder. I have had to import column 2 from another work sheet although it's the same data in the same layout. So now I have two columns of "x's" but I only want one so I need to have a formula in Col 3 to effectively display what Col1 & Col2 show but combined.

The data itself is fairly irrelevant i'm pretty sure seeing that the only thing we need for this are the three columns?

Thanks for your help.
So are you trying to count how many x's there are in total, or in a given column, or in a given row? Or are you trying to populate the 3rd column with the combined contents of columns 1 and 2?

It still isn't too clear what you are trying to do.
 
Upvote 0
Hi skuddy

In C2 you can do one of the following, then drag it down to the bottom of your sheet (assumes the two columns containing the x's start in A2 and B2):

=A2&B2 this combines the two together
=IF(LEN(A2&B2)=0,"","x") this returns an x if either has anything in
=IF(COUNTIF(A2:B2,"x"),"x","") this returns an x if either cell has an x

Hope that helps

Mackers
 
Upvote 0
Hi skuddy

In C2 you can do one of the following, then drag it down to the bottom of your sheet (assumes the two columns containing the x's start in A2 and B2):

=A2&B2 this combines the two together
=IF(LEN(A2&B2)=0,"","x") this returns an x if either has anything in
=IF(COUNTIF(A2:B2,"x"),"x","") this returns an x if either cell has an x

Hope that helps

Mackers


spot on fella, cheers
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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