"if function" return value based on 2 adjacent cells

MrDeals

New Member
Joined
Nov 26, 2018
Messages
5
Hi,

I am trying use a "if function" to return value based on 2 adjacent cells and drag it down all the way till the next matching data.

i.e. If column B matches "Customer ID:" then display the code

with this formula =IF(B:B="Customer ID:",C:C,"")
I am able to do only on the same row, how can I drag it down to the next rows?

Thank You



T0cKF0T
T0cKF0T
H.jpg
 

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.
You don't put full column references, rather, you put exact cell addresses (without $ signs) and Excel will automatically increment the cell reference as you drag the formula. So, for what you showed us, put this formula in cell A2 and drag it down...

=IF(B2="Customer ID:",C2,"")
 
Upvote 0
Sorry to intrude Rick but I read the OP's request a bit different. To me it looked like the OP needed the customer ID on each row similar to a GoTo Blanks and copy the customer ID down if the ID was already in Column A as indicated.

In this case I would use

=IF(B2="Customer ID:",C2,A1)

and copy that down.
 
Upvote 0
Sorry to intrude Rick but I read the OP's request a bit different. To me it looked like the OP needed the customer ID on each row similar to a GoTo Blanks and copy the customer ID down if the ID was already in Column A as indicated.

In this case I would use

=IF(B2="Customer ID:",C2,A1)

and copy that down.


rasinc Thank you, this works perfectly!

Rick Rothstein I appreciate your assistance as well.
 
Upvote 0

Forum statistics

Threads
1,223,953
Messages
6,175,598
Members
452,658
Latest member
GStorm

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