p_gillespie
New Member
- Joined
- Jun 10, 2014
- Messages
- 5
Hi,
I'm trying to specify a range for count if based on the value of a cell - if this is possible (i cant work it out using either type of cell reference), if not i'm looking for a way of doing this?
ie. cell E7 currently has =IF(COUNTIF(E3:E6,"No")>0,"No","Yes") but i would like the range part of it to be "current cell -1 row (E(6-1)":"current cell - "look up value in C6 (E6-4) if this makes sense, to allow me to copy the row for hundreds of dishes and it change the look up range automagically without having to use hundreds of sheets. I have tried using R1C1 but cant get it to work right.
Copy & Paste of simplified worksheet below if it benefits anyone.
Thanks
Pete
[TABLE="width: 583"]
<tbody>[TR]
[TD="align: right"]A1[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Dish Number[/TD]
[TD]Ingredient Number[/TD]
[TD]Product Description[/TD]
[TD]Suitable for a Vegan Diet[/TD]
[TD]Suitable for a Vegetarian Diet[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD]Tortilla Chips[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD]Salsa[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD]Guacamole[/TD]
[TD]No[/TD]
[TD]YES[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD="align: right"]4[/TD]
[TD]Sour Cream[/TD]
[TD]No[/TD]
[TD]YES[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD][/TD]
[TD]Nachos[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD]Vegie quarter pounder[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD]Lettuce[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD]Tomato[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD][/TD]
[TD="align: right"]4[/TD]
[TD]Chips[/TD]
[TD]Yes[/TD]
[TD]yes[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD][/TD]
[TD="align: right"]5[/TD]
[TD]red onion[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD][/TD]
[TD="align: right"]6[/TD]
[TD]Burger Bun[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD][/TD]
[TD][/TD]
[TD]Burger [/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
</tbody><colgroup><col span="3"><col><col span="2"></colgroup>[/TABLE]
I'm trying to specify a range for count if based on the value of a cell - if this is possible (i cant work it out using either type of cell reference), if not i'm looking for a way of doing this?
ie. cell E7 currently has =IF(COUNTIF(E3:E6,"No")>0,"No","Yes") but i would like the range part of it to be "current cell -1 row (E(6-1)":"current cell - "look up value in C6 (E6-4) if this makes sense, to allow me to copy the row for hundreds of dishes and it change the look up range automagically without having to use hundreds of sheets. I have tried using R1C1 but cant get it to work right.
Copy & Paste of simplified worksheet below if it benefits anyone.
Thanks
Pete
[TABLE="width: 583"]
<tbody>[TR]
[TD="align: right"]A1[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Dish Number[/TD]
[TD]Ingredient Number[/TD]
[TD]Product Description[/TD]
[TD]Suitable for a Vegan Diet[/TD]
[TD]Suitable for a Vegetarian Diet[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD]Tortilla Chips[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD]Salsa[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD]Guacamole[/TD]
[TD]No[/TD]
[TD]YES[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD="align: right"]4[/TD]
[TD]Sour Cream[/TD]
[TD]No[/TD]
[TD]YES[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD][/TD]
[TD]Nachos[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD]Vegie quarter pounder[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD]Lettuce[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD]Tomato[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD][/TD]
[TD="align: right"]4[/TD]
[TD]Chips[/TD]
[TD]Yes[/TD]
[TD]yes[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD][/TD]
[TD="align: right"]5[/TD]
[TD]red onion[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD][/TD]
[TD="align: right"]6[/TD]
[TD]Burger Bun[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD][/TD]
[TD][/TD]
[TD]Burger [/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[/TR]
</tbody><colgroup><col span="3"><col><col span="2"></colgroup>[/TABLE]