IF with reference to other cells

theanoon

New Member
Joined
Apr 21, 2014
Messages
15
Hi all,

I am compiling this table to another worksheet using IFs, but I want the result to not have the empty cell in between.

NameTypeType
ADOGCAT
BFISHPRAWN
ADOGCAT
ADOGCAT
BFISHPRAWN
BFISHPRAWN

<tbody>
</tbody>














I'm currently using this =if(IF($A2="A",B2,"")

DOGCAT
DOGCAT
DOGCAT

<tbody>
</tbody>











Is there other workaround that I can compile if A, then DOG-CAT, or if B, then FISH-PRAWN in a proper list?

Thanks in advance :)
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi theanoon

its not 100% clear what you are trying to do here but I think i get you.

Code:
=IF(A2="","",VLOOKUP(A2,$A$2:$C$7,2)&"-"&VLOOKUP(A2,$A$2:$C$7,3))

if its not what you are after then let me know and I'll have another go.
 
Upvote 0
Hi friel300, thanks for your reply.

Yes, perhaps my explanation is not that clear. Im looking to for a table, with the name, minus the empty rows

The current ones are with empty rows:
Name A
Dog-cat
----------*empty row*
Dog-cat
Dog-cat
----------*empty row*
Dog-cat

I'm looking all the rows to be filled up, referring to the whole table e.g.;
Name A
Dog-cat
Dog-cat
Dog-cat
Dog-cat
 
Upvote 0
so you need a macro to remove blank rows?

would sorting the data not satisfy your needs?

sorry if im still not 100% getting it.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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