Lookup a column name for a reference in a cell

PitMyShants

New Member
Joined
Aug 10, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all. First time poster here. I have found myself in an odd spot and am wondering if it is possible to do something instead of using a pivot table for said purpose. I'd prefer not to use a pivot table as the data will change often and I am likely to gain/lose values. I do not want to worry about my pivot resizing because I wish to compare the values from the pivot with another sheet. I know, odd situation but I'm really just curious.

Take a look at my pic here. In Sheet 2, I want to use a COUNTIFS function. The piece that I am missing is labeled XXX in the formula within column J. Ideally, I'd be able to substitute another formula for XXX that would return column D as a match (based on the value in H3. Is there a formula that I could use here with the array A2:F2 in Sheet 1 to return the value "Vendor1" which could then be used in the COUNTIFS function?

The big reason for this is because In this case there are 20 different columns I'd expect to use as an array in the COUNTIFS function. Certainly not the end of the world if I had to hardcode what cols I had for each one, but again.. curious.
 

Attachments

  • excel question.jpg
    excel question.jpg
    70.1 KB · Views: 4

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Book1
ABCDEF
2IDTypePriceVendor1Vendor2Vendor3
31DRZ101UNDEROVEROVER
42DRZ102OVEROVEROVER
53SXC101OVERUNDEROVER
64SXC104UNDERUNDEROVER
75LTZ103UNDERUNDEROVER
86DRZ100UNDERUNDER
Sheet1

Book1
ABCD
2VendorTypeUnderOver
3Vendor1DRZ21
4Vendor1SX00
5Vendor2DRZ12
Sheet2
Cell Formulas
RangeFormula
C3:D5C3=SUMPRODUCT((Sheet1!$B$3:$B$8=$B3)*(Sheet1!$D$2:$F$2=$A3)*(Sheet1!$D$3:$F$8=C$2))
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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