if value = certain text then return value of different cell

tijgerleks

New Member
Joined
Jul 26, 2017
Messages
2
Hi everyone !

so i need some help with what i said in the title.

i will try the best i can to explain what i need.

i have three collums
product code, type , discount code

the 3rd collum will have a specified discount code which can be anything, for now i only have this one "FACELESSCAT10"

on a different page i want every row with the that specified discount code to give the product code but only where that discount code was used

imagine i have
A B C
product code / type / discount code /
----------------------------------------------------
2 HCMA014 / bracelet / FACELESSCAT10
3 HCMA016 / bracelet / no code used
4 HCMA021 / sunnycord / FACALESSCAT10



in a different page i want all the products that were bought with the discount code FACELESSCAT10 to be there whenever they are entered in the first page
so it would look something like this

A B
product code / type /
--------------------------------
2 HCMA014 / bracelet /
3 HCMA021 / sunnycord /

i imagine the formula would look something like this

=VLOOKUP(lookup_value, IF(lookup_value="FACELESSCAT10",range1,range2),2,0)

but i am not sure what the values would be


i hope someone can help me

thanks in advance!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Sheet 1
A
B
C
1
Product code
type
discount code
2
HCMA014
bracelet
FACELESSCAT10
3
HCMA016
bracelet
no code used
4
HCMA021
sunnycord
FACELESSCAT10

<tbody>
</tbody>


Sheet 2

A
B
1
Product code
type
2
HCMA014
bracelet
3
HCMA021
sunnycord
4
5

<tbody>
</tbody>

In Sheet 2 This is an array formula and must be committed with CONTROL+SHIFT+ENTER. If done correctly Excel will but {} around the formula. Copy across and down
Code:
=IF(ROWS(A$2:A2)>COUNTIF(Sheet1!$C$2:$C$4,"FACELESSCAT10"),"",INDEX(Sheet1!A$2:A$4,SMALL(IF(Sheet1!$C$2:$C$4="FACELESSCAT10",ROW(Sheet1!$C$2:$C$4)-ROW(Sheet1!$C$2)+1),ROWS($A$2:A2))))
 
Upvote 0
wauw thanks a lot !
altough i have a slight problem still.

because the sheets arent called sheet 1 and 2 and arent in the same excel workbook i cant simply copy paste it
also my excel is in dutch so IF ROWS COUNTIF dont work so i need to put the correct one in dutch (thats no problem though)

i will try to manage it anyway

it would be easier if you said it like this by steps
1 = IF(ROWS select rows that contain x ) >
2 = IF(ROWS(XXX)>COUNTIF(
select rows )

but that would be a hell of a hassle i imagine
 
Upvote 0

Forum statistics

Threads
1,215,645
Messages
6,125,995
Members
449,279
Latest member
Faraz5023

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