Populating Cells Automatically If Other Cell Contains Specific Text

mattwolves

New Member
Joined
Mar 9, 2018
Messages
7
Hi folks, I'm hoping someone can help me with with my query.
I'm new to the site so please be gentle :)
I'm trying to write a spreadsheet for instructing someone to raise a purchase order if a cell is populated.
For example Sheet 1 would look like this below
Reference (column a)Raise Order (column b)
828282
837489yes
354739
838483yes
838482
838481
838488
838480yes
838489

<tbody>
</tbody>

With Sheet 2 looking something like below. Is there a way without using VBA to populate cells in column a with the reference number of column a from sheet 1 if column b (in sheet 1) has "yes"?
Reference (column a)(column b)
837489
838483
838480

<tbody>
</tbody>

Hope I've explained myself well.
Thanking you in advance
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I've got my sheet set up like your example:
AB
1ReferenceRaise Order
2828282
3837489yes
4354739
5838483yes
6838482
7838481
8838488
9838480yes
10838489

<tbody>
</tbody>


And here's how I set up sheet 2:
(Just copy the formula in A2 down to the rest of the cells in the column)


A
1Reference
2=IF(Sheet1!B2="yes",Sheet1!A2,"")
3=IF(Sheet1!B3="yes",Sheet1!A3,"")
4=IF(Sheet1!B4="yes",Sheet1!A4,"")
5=IF(Sheet1!B5="yes",Sheet1!A5,"")
6=IF(Sheet1!B6="yes",Sheet1!A6,"")
7=IF(Sheet1!B7="yes",Sheet1!A7,"")
8=IF(Sheet1!B8="yes",Sheet1!A8,"")
9=IF(Sheet1!B9="yes",Sheet1!A9,"")
10=IF(Sheet1!B10="yes",Sheet1!A10,"")

<tbody>
</tbody>
Sheet2


Using VBA, we'd be able to make it look a little prettier, but this is the best way I can think of without using a macro.

You could get rid of the spaces between the rows with data by applying a filter. Select cells A1:A10 in sheet2 and press CTRL + Shift + L.

You'll see a drop-down arrow appear. Click on it, and uncheck "blanks". This will hide the blank rows to make your sheet look more presentable. If you ever need to unhide them, just click on the drop-down arrow again, and re-check "blanks".

Hope this helps!

Matt
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,883
Members
449,477
Latest member
panjongshing

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