Nested Formula Issues

janema

Board Regular
Joined
Nov 28, 2022
Messages
143
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2011
  5. 2010
Platform
  1. Windows
  2. Mobile
I am having issues with figuring out the right way to write this formula. I am trying to get the formula to multiply the total in cell H4 (which is a currently an XLOOKUP formula) by the value in H2 if G4 equals "A4H" and to multiply the total in cell H4 by the value in cell I2 if G4 equals "TZZ." If it doesn't equal either, I want it just to stay as it is currently. Is this not possible because there is an XLOOKUP in that field currently? I've tried the following formulas and no luck, just getting errors.

=IF(G4="A4H",$H$1*H4,IF(G4="TZZ",$I$1*H4,H4)))

=IF(G4="A4H",$H$1*H4,IF(G4="TZZ",$I$1*H4,H4)))

=IF(G4="A4H",$H$1*XLOOKUP(A4,Census!C:C,Census!BT:BT),IF(G4="TZZ",$I$1*XLOOKUP(A4,Census!C:C,Census!BT:BT),XLOOKUP(A4,Census!C:C,Census!BT:BT)))))


Thank you so much in advance for your help!! Your amazing brain power is very much appreciated!


1721256560924.png
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
What happens with the formula below? Please note I am using H1 and I1 as per your formula rather than H2 and I2 as per your question, amend if different

Excel Formula:
=IF(G4="A4H",($H$1+0)*H4,IF(G4="TZZ",($I$1+0)*H4,H4))
 
Upvote 0
What happens with the formula below? Please note I am using H1 and I1 as per your formula rather than H2 and I2 as per your question, amend if different

Excel Formula:
=IF(G4="A4H",($H$1+0)*H4,IF(G4="TZZ",($I$1+0)*H4,H4))

It returns "0" when I use that formula. :(
 
Upvote 0
Did you amend the H1 and I1 if different with your data as stated?
 
Upvote 0
XLOOKUP itself probably wouldn't be the issue
Book1
GHIJKLMNOPQR
148bda2
2b4
3c6
4A4H238d8
Jan1
Cell Formulas
RangeFormula
H1:I1H1=XLOOKUP(N1,$Q$1:$Q$4,$R$1:$R$4)
L4L4=IF(G4="A4H",($H$1+0)*H4,IF(G4="TZZ",($I$1+0)*H4,H4))


What do you get with
Excel Formula:
=IF(G4="A4H",(TRIM($H$1)+0)*H4,IF(G4="TZZ",(TRIM($I$1)+0)*H4,H4))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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