need formula instead of macro

Savuti

Board Regular
Joined
Apr 30, 2008
Messages
156
Hello, I need a formula in "C9" that will search cells "C3:H3" to match a date in "A5" then copy the corresponding data in row "C6:H6" to "C9".

Is it possible to have a formula do this instead of a macro.

Thanks for the help.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,

Maybe this.

Formula in C9
=IF(ISNUMBER(MATCH($A$5,$C$3:$H$3,0)),C6,"")
copy across til H9

HTH

M.
 
Upvote 0
If you just want to copy the cells as they appear in row 3 use

Code:
=IF($A$5=C3;C3;"")

If you want to actually search the whole array use

Code:
=HLOOKUP($A$5;$C$3:$H$3;1;FALSE)
 
Upvote 0
Hello Marcelo, I have entered the formula you gave. It so happens that the date in "A5" matches to the date in "E3" so it should pull the data from "E6" to "C9" - the formula copies data from "C6" to "C9"
 
Upvote 0
Sorry, i misunderstood your problem. I thought you need to copy the entire row 6 to row 9.

Try this in C9
=IF(ISNUMBER(MATCH($A$5,$C$3:$H$3,0)),INDEX($C$6:$H$6,MATCH($A$5,$C$3:$H$3,0)),"")

HTH

M.
 
Upvote 0
Or if you have Excel 2007 or higher

=IFERROR(INDEX($C$6:$H$6,MATCH($A$5,$C$3:$H$3,0)),"")

M.
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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