Automatically fill a cell based only on a non-zero value in another cell

l1011driver

Board Regular
Joined
Dec 26, 2014
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Thanks in advance for any help or advice.

I'm not sure how to include an Excel fragment in the post so I'll do it the old fashioned way.

I have 4 columns. In column A are calendar dates. In column B are values of either 0, 1 or 2. These values are manually inserted by the user.

What I would like to do is this:

If column B is a non-zero value I would like Excel to insert the date of the corresponding cell in column A into column C. In column D I would like Excel to insert the non-zero value from column B. If the value in column B is 0 then I would like Excel to ignore both the 0 and the corresponding date.

For example:

A B C D

June 1 1 June 1 1
June 5 0 June 10 2
June 10 2
June 30 0

Is there a formula or a macro that will allow me to do this?

Thanks for any help or ideas.
 
Last edited:
If A1 has "1/8/2017" how does that correspond to a "2" in "B1"

you said:
There will never be a value entered in a cell in column B that doesn't have a date associated with it in column A
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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