SumIF in multiple columns in VB

davidhall80

Well-known Member
Joined
Jul 8, 2006
Messages
663
I get a data dump in columns A to Q. I want to do a SUMIF but the data is spread across multiple columns. for example....where ever there is the word "Computer" or "Phone"......to the right cell of "Computer" or "Phone" ....there is a numerical value. Is it possible for me to add all these values together since they are in different columns. I would like an input box to pop up. In the input box, I would enter the word "Computer" or whatever reference I need and then I would get the sum of all of the values to the right cell of that word in columns A to Q. Is this possible.

example

..........A.............B..........C..........D..........E..........F..........G
1...Computer....$10.............................Phone $35

2.....Phone........$35

3..............................Computer....$25

4

5

6.....................................................Computer....$50

7



I would like the Input box to pop up, then I'd put Computer....and than another input box would return the value $85 (50+25+10)
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello,

why VB

=SUMPRODUCT(--($A$1:$Q$20=S1),OFFSET($A$1:$Q$20,0,1))

where S1 = computer
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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