exceldotcom

New Member
Joined
Jul 2, 2018
Messages
15
Hi everyone,

Got a formula here that is calculating oddly. Not sure if I am missing something.

=IF(AND(VLOOKUP(D23,D:P,11,FALSE)="Yes",G23=0),0,+Y23-Z23)

The formula is FALSE (which is correct) so the bolded section is the part pulling the calculation of the following (the calculation is subtracting YTD from the most recent month, which should be $0 for everyone currently):

Y23 = 25818.9122075294
Z23 = 25818.9122075294

For other member calculations I'm getting "$-" in the cell, which is correct. However, for this member I'm getting "$0.00". All the cells are formatted as "Accounting".

Any ideas?

Thanks!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Looks like G23 does not equal 0, so your formula is returning 0.

=IF(AND(VLOOKUP(D23,D:P,11,FALSE)="Yes",G23=0),0,+Y23-Z23)
 
Upvote 0
You might have the floating arithmetic situation going on, which makes Excel think there is some tiny fractional difference (see: https://www.microsoft.com/en-us/mic...y-does-excel-give-me-seemingly-wrong-answers/).

Since you are only returning two decimal places, rounding to two places should take care of that, i.e.
Code:
[COLOR=#333333]=IF(AND(VLOOKUP(D23,D:P,11,FALSE)="Yes",G23=0),0,[B]ROUND([/B][/COLOR][B]Y23-Z23,2))[/B]

You might need/want to round G23 also, just to be sure, i.e.
Code:
[COLOR=#333333]=IF(AND(VLOOKUP(D23,D:P,11,FALSE)="Yes",[B]ROUND(G23,2)[/B]=0),0,[B]ROUND([/B][/COLOR][B]Y23-Z23,2))[/B]
 
Last edited:
Upvote 0
Thank you! Adding the =ROUND in has fixed this. Still odd as per my hardcoded value above, the numbers are identical (and
receive a TRUE statement from an =EXACT formula...).
 
Upvote 0

Forum statistics

Threads
1,214,868
Messages
6,122,005
Members
449,059
Latest member
mtsheetz

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