VBA/formula: if there's a cell in column B = 1, column D = 1, select that row and copy value in column H

JennV

New Member
Joined
May 9, 2019
Messages
34
Hello there,

I'm hoping to get some help/insight on how I'm able to complete this task.

On Sheet 1:
BD H
111.1
211.2
222.2
233.2
124.3

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>

On Sheet 2, for example, I want the value in column H in the row where column B=1 and column D=1 (in this case, "1.1").
Another example, I want the value in column H in the row where column B=1 and column D=2 (in this case, "4.3").

Thank you in advance!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Welcome to Mr Excel Forum

Maybe something like this

Sheet2

A
B
C
1
Crit1​
Crit2​
Result​
2
1​
1​
1,1​
3
1​
2​
4,3​
4

Criteria in columns A:B

Formula in C2 copied down
=SUMIFS(Sheet1!H:H,Sheet1!B:B,A2,Sheet1!D:D,B2)

Hope this helps

M.
 
Upvote 0
Welcome to Mr Excel Forum

Maybe something like this

Sheet2

A
B
C
1
Crit1​
Crit2​
Result​
2
1​
1​
1,1​
3
1​
2​
4,3​
4

<tbody>
</tbody>


Criteria in columns A:B

Formula in C2 copied down
=SUMIFS(Sheet1!H:H,Sheet1!B:B,A2,Sheet1!D:D,B2)

Hope this helps

M.


This worked! Thank you so, so much!
 
Upvote 0
What you mean by "copy that blank"? You want a blank result instead of zero, do you?

M.

Yes, sorry - I should've finished my sentence.

Using your SUMIFS formula, blanks cells in column H of sheet1 = 0 in sheet2. I am familiar with making that 0 look blank using conditional formatting (visually/presentation) but I don't want that cell to have the value 0 but to simply be blank as it is on sheet1 (no value). Is there a possibility of making this happen? I'm assuming another function needs to be used?

Thanks for being so patient with me. I'm on a project with very limited Excel knowledge so this forum is helping me learn alot!
 
Upvote 0
Try something like this

=IF(<formulahere>formulahere=0,"",formulahere<formulahere>)

M.</formulahere></formulahere>
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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