# Combining rows

[Closed]
-
Posts
2809
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 23, 2021
-
Hello,

My situation is similar to a question that was asked but not exactly the same. This is how my spreadsheet looks now:

A 1 1 0 0 1 1
A 0 1 1 0 1 1
B 1 0 0 0 0 1
B 0 0 0 0 1 1

I would like to combine those into two rows like this:

A 1 1 1 0 1 1
B 1 0 0 0 1 1

If you know a way could you please explain the steps. Not just "use this formula". I'm newer to Excel so need a little more step-by-step. Thank you!

Posts
2809
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 23, 2021
484
Hi Matt,

Well, you could use a combination of IF and OR functions to check if the result needs to be a 1 or 0. Like:
=IF(OR(B1=1,B2=1),1,0)
So if either B1 or B2 is 1 then result will be 1, otherwise 0.

But depending on your amount of data it will be more beneficial to use a code.

So how much data are we talking about?
And also, is your data always grouped on 2 lines?