How do I create a formula for a checklist that if checked picks values from dispersed cells?

edude

New Member
Joined
Sep 14, 2023
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
Hi, I'm trying to do this elegantly

=SUM(IF(E7:U7="x";value1 for E7, value2 for F7, value3 for G7...;0)
The cell in the right should be a a formula that sums all the elements checklisted with an x. Each of those cells it's a checklist of elements with a cost assigned in dispersed cells that are added up in the cell in the right.
1694674294679.png

Right now the formula looks like this and works but i'm guessing there is a better way to do it

1694674366103.png
 

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.
Below is a version where you would create a lookup table for the dispersed cells, the lookup table would hold the column numbers of the headers in the main table. I then looks at the column where it finds an "x" and looks it up from the table and then sums those values.

Book1
ABCDEFGHIJKLMNOPQRST
1BreadJamCheeseOnionsPeasCrispsJuiceTotalLookup tabledispersed cells
2Food Delvery 1xxxxx£8.00ColumnFoodPriceBread£1.00
3Food Delvery 2xx£4.002Bread£1.00
43Jam£1.00Cheese£1.00
54Cheese£1.00
65Onions£2.00
76Peas£1.00Jam£1.00
87Crisps£3.00
98Juice£3.00Onions£2.00
10
11
12Peas£1.00
13
14Crisps£3.00
15
16
17Juice£1.00
18Juice£1.00
19Juice£1.00
Sheet1
Cell Formulas
RangeFormula
I2:I3I2=SUM(XLOOKUP(IF(B2:H2="x",COLUMN(B2:H2),""),$L$3:$L$9,$N$3:$N$9,0))
N3,N5N3=R2
N4N4=R7
N6N6=S9
N7N7=R12
N8N8=T14
N9N9=SUM(R17:R19)
 
Upvote 0
This is reasonably similar to the previous suggestion but doesn't require a lookup as such. It does, however, rely on things being put in the correct order at set-up.

I can't quite follow your formula since you mentioned cells E7:U7 but what we can see of the formula it appears to skip cells F7, G7 & H7.
1694684436213.png


Anyway, see if this is some use. It is a smaller example but hopefully shows the idea.
Set up a range of cells in 'Elementos' (though it could be anywhere really) like I have in AA1:AD1. The formula in each of those cells should point to the relevant cell in the relevant order. That is the first cell (AA7) should point to the relevant cell for if E7 on the formula sheet has an "x", the second cell (AB7) should point to the relevant cell for if F7 on the formula sheet has an "x" etc
This row or these columns could then be hidden if you want.

edude.xlsm
JZAAABACAD
153669
2
5
65
7
14
1566
16
19
209
21
28
293
Elementos
Cell Formulas
RangeFormula
AA1AA1=J6
AB1AB1=J29
AC1AC1=J15
AD1AD1=J20


Then you can use a formula like this to get the sum you want.

edude.xlsm
EFGHVW
7xxx80
8x3
90
10xxxx83
11xx14
Sheet1
Cell Formulas
RangeFormula
W7:W11W7=SUM(FILTER(Elementos!AA$1:AD$1,E7:H7="x",0))
 
Upvote 0
Thanks guys you are great. In the end, inspired with your recommendation i just organized all the dispersed values in a table and did it with a regular sumif.
 
Upvote 0
Cheers. Glad you have it sorted. Thanks for letting us know. (y)
 
Upvote 0

Forum statistics

Threads
1,215,130
Messages
6,123,220
Members
449,091
Latest member
jeremy_bp001

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